mirror of
https://github.com/movie-web/movie-web.git
synced 2025-01-13 23:19:11 +01:00
parse dates instead of cringe string manipulation
This commit is contained in:
parent
430486a9b9
commit
984d215312
@ -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…
x
Reference in New Issue
Block a user