mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
feat: dida365 sort and pubDate
This commit is contained in:
@@ -49,12 +49,14 @@ module.exports = async (ctx) => {
|
||||
for (const habitId in checkins.checkins) {
|
||||
const info = habitsList.find((item) => item.id === habitId);
|
||||
list = list.concat(
|
||||
checkins.checkins[habitId].map((checkin, index) => ({
|
||||
title: `第${index + 1}天${info.name}打卡`,
|
||||
pubDate: checkin.checkinTime,
|
||||
link: `https://dida365.com/webapp/#q/all/habit/${checkin.habitId}`,
|
||||
guid: checkin.id,
|
||||
}))
|
||||
checkins.checkins[habitId]
|
||||
.sort((a, b) => a.checkinStamp - b.checkinStamp)
|
||||
.map((checkin, index) => ({
|
||||
title: `第${index + 1}天${info.name}打卡`,
|
||||
pubDate: `${(checkin.checkinStamp + '').slice(0, 4)}-${(checkin.checkinStamp + '').slice(4, 6)}-${(checkin.checkinStamp + '').slice(6, 8)}`,
|
||||
link: `https://dida365.com/webapp/#q/all/habit/${checkin.habitId}`,
|
||||
guid: checkin.id,
|
||||
}))
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user