mirror of
https://github.com/movie-web/movie-web.git
synced 2024-11-11 04:35:09 +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,
|
title: movie.title,
|
||||||
object_type: mediaTypeToTMDB(type),
|
object_type: mediaTypeToTMDB(type),
|
||||||
poster: movie.poster_path ?? undefined,
|
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) {
|
if (type === MWMediaType.SERIES) {
|
||||||
@ -69,7 +69,7 @@ export function formatTMDBMetaResult(
|
|||||||
title: v.name,
|
title: v.name,
|
||||||
})),
|
})),
|
||||||
poster: (details as TMDBMovieData).poster_path ?? undefined,
|
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 New Issue
Block a user