diff --git a/.travis.yml b/.travis.yml index fb6a0a6..5769fec 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,8 @@ language: node_js sudo: false +before_script: + - export TZ=Europe/Moscow + - date matrix: include: - node_js: '8.11.2' @@ -8,4 +11,3 @@ matrix: before_install: npm -g i npm@2 - node_js: '10.2.1' before_install: npm -g i npm@2 - diff --git a/lib/index.js b/lib/index.js index 5c02245..adb64ed 100755 --- a/lib/index.js +++ b/lib/index.js @@ -26,7 +26,7 @@ function generateXML(data) { item_values.push({link: item.url}); item_values.push({'turbo:source': item.url}); - ifTruePush(item.date, item_values, {pubDate: new Date(item.date).toGMTString()}); + ifTruePush(item.date, item_values, {pubDate: new Date(item.date).toUTCString()}); ifTruePush(item.author, item_values, {author: item.author}); let img = ''; diff --git a/test/expectedOutput/relatedItem.xml b/test/expectedOutput/relatedItem.xml index 27b321f..0b266e7 100644 --- a/test/expectedOutput/relatedItem.xml +++ b/test/expectedOutput/relatedItem.xml @@ -1 +1 @@ -<![CDATA[title]]>http://example.com/rss.xmlruhttp://example.com/article4?this&thathttp://example.com/article4?this&thatSat, 26 May 2012 21:00:00 GMTLightAir

item title

hello

]]>
related link text 1related link text 2
+<![CDATA[title]]>http://example.com/rss.xmlruhttp://example.com/article4?this&thathttp://example.com/article4?this&thatSat, 26 May 2018 21:00:00 GMTLightAir

item title

hello

]]>
related link text 1related link text 2
diff --git a/test/index.js b/test/index.js index 0b5e815..1d32b06 100644 --- a/test/index.js +++ b/test/index.js @@ -45,7 +45,7 @@ test('related item', function(t) { image_url: 'http://example.com/example.png', url: 'http://example.com/article4?this&that', author: 'LightAir', - date: 'May 27, 2012', + date: 'May 27, 2018 00:00 AM', content: '

hello

', related: [{ link: 'http://example.com/related/post1',