fix(route): fix luogu route date parse regex (#11200)
* fix(route): fix luogu route date parse regex
```
text: "洛谷日报 第 417 期 2022 年 11 月 1 日"
regex: \d{4} 年 \d{2} 月 \d{2} 日
^
error here
```
* change DD to D and MM to M in date format.
* fix regex to match month which is before Oct
This commit is contained in:
parent
63c2f82c01
commit
04d421b1f4
|
|
@ -21,7 +21,7 @@ module.exports = async (ctx) => {
|
|||
link,
|
||||
author: firstPost.find('p').eq(1).text(),
|
||||
guid: `${link}#${issueHeading}`,
|
||||
pubDate: parseDate(issueHeading.match(/(\d{4} 年 \d{2} 月 \d{2} 日)/)[1], 'YYYY 年 MM 月 DD 日'),
|
||||
pubDate: parseDate(issueHeading.match(/(\d{4} 年 \d{1,2} 月 \d{1,2} 日)/)[1], 'YYYY 年 M 月 D 日'),
|
||||
},
|
||||
];
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue