mirror of
https://github.com/sussy-code/smov.git
synced 2024-12-29 16:07:40 +01:00
parse dates instead of cringe string manipulation
This commit is contained in:
parent
430486a9b9
commit
984d215312
1 changed files with 2 additions and 2 deletions
|
@ -54,7 +54,7 @@ export function formatTMDBMetaResult(
|
|||
title: movie.title,
|
||||
object_type: mediaTypeToTMDB(type),
|
||||
poster: movie.poster_path ?? undefined,
|
||||
original_release_year: Number(movie.release_date?.split("-")[0]),
|
||||
original_release_year: new Date(movie.release_date).getFullYear(),
|
||||
};
|
||||
}
|
||||
if (type === MWMediaType.SERIES) {
|
||||
|
@ -69,7 +69,7 @@ export function formatTMDBMetaResult(
|
|||
title: v.name,
|
||||
})),
|
||||
poster: (details as TMDBMovieData).poster_path ?? undefined,
|
||||
original_release_year: Number(show.first_air_date?.split("-")[0]),
|
||||
original_release_year: new Date(show.first_air_date).getFullYear(),
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue