Skip to content

Commit

Permalink
fix(route): yicai wrong pubDate (#7137)
Browse files Browse the repository at this point in the history
  • Loading branch information
queensferryme authored Mar 11, 2021
1 parent 5113c97 commit e673434
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/routes/yicai/brief.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const date = require('@/utils/date');
const got = require('@/utils/got');

module.exports = async (ctx) => {
Expand All @@ -15,11 +16,11 @@ module.exports = async (ctx) => {
const resList = response.data;
const item = resList.map((obj) => {
const { datekey, istop, url, newcontent, hm, indexTitle } = obj;
const dateStr = `${datekey.replace('.', '-')} ${hm}`;
const dateStr = `${datekey.replace(/\./g, '-')} ${hm}`;
return {
title: indexTitle.length === newcontent.length ? indexTitle : `${indexTitle}...`,
description: [istop ? '置顶:' : '', newcontent].filter((str) => !!str).join('<br/>'),
pubDate: new Date(dateStr).toUTCString(),
pubDate: date(dateStr, +8),
link: `${baseUrl}${url}`,
};
});
Expand Down

0 comments on commit e673434

Please sign in to comment.