fix: 修复 tmdb 未记录发行日期的剧集全部堆叠在今天的问题

This commit is contained in:
amtoaer
2023-09-02 00:36:06 +08:00
parent 9c5ef8f5b4
commit b522b4d355
2 changed files with 4 additions and 4 deletions

View File

@@ -88,9 +88,9 @@ export function formatSeconds(seconds: number) {
}
// YYYY-MM-DD 转化为Date
export function parseDate(dateString: string): Date {
export function parseDate(dateString: string): Date | null {
if (!dateString)
return new Date()
return null
const [year, month, day] = dateString.split('-').map(Number)
return new Date(year, month - 1, day)