mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-01 14:57:14 +08:00
fix: catch Invalid Date (#17081)
This commit is contained in:
@@ -74,8 +74,16 @@ const middleware: MiddlewareHandler = async (ctx, next) => {
|
||||
}
|
||||
|
||||
if (outputType !== 'rss') {
|
||||
item.pubDate && (item.pubDate = convertDateToISO8601(item.pubDate) || '');
|
||||
item.updated && (item.updated = convertDateToISO8601(item.updated) || '');
|
||||
try {
|
||||
item.pubDate && (item.pubDate = convertDateToISO8601(item.pubDate) || '');
|
||||
} catch {
|
||||
item.pubDate = '';
|
||||
}
|
||||
try {
|
||||
item.updated && (item.updated = convertDateToISO8601(item.updated) || '');
|
||||
} catch {
|
||||
item.updated = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user