Skip to content
This repository has been archived by the owner on Feb 23, 2021. It is now read-only.

Commit

Permalink
buildIntro lang
Browse files Browse the repository at this point in the history
  • Loading branch information
dylano committed Sep 13, 2018
1 parent f2dd53a commit ba71d0b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion command/CommandController.js
Expand Up @@ -827,7 +827,8 @@ function buildIntro(article) {
//Intro: “article title, published by host, on publish date"
let introFullText;
let dateOptions = { year: 'numeric', month: 'long', day: 'numeric' };
if (article.lang == 'en') {
const articleLang = article.lang ? article.lang : 'en';
if (articleLang === 'en') {
if (article.timePublished) {
let publishedDate = new Date(article.timePublished * 1000);
let dateString = publishedDate.toLocaleDateString('en-US', dateOptions);
Expand Down Expand Up @@ -859,6 +860,7 @@ function buildIntro(article) {
: `${article.title}.`;
}
}
logger.debug('** leaving buildIntro');
return introFullText;
}

Expand Down

0 comments on commit ba71d0b

Please sign in to comment.