1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Add support for plugin revisions with bad timestamps

This commit is contained in:
Bill Thornton 2024-10-28 10:10:11 -04:00
parent d4d84d0a18
commit 3062f0f38c
2 changed files with 19 additions and 3 deletions

View file

@ -203,12 +203,28 @@ export function toLocaleTimeString(date, options) {
return date.toLocaleTimeString();
}
export function getDisplayDateTime(date) {
if (!date) {
throw new Error('date cannot be null');
}
if (typeof date === 'string') {
try {
date = parseISO8601Date(date, true);
} catch (err) {
return date;
}
}
return toLocaleString(date);
}
export function getDisplayTime(date) {
if (!date) {
throw new Error('date cannot be null');
}
if ((typeof date).toString().toLowerCase() === 'string') {
if (typeof date === 'string') {
try {
date = parseISO8601Date(date, true);
} catch (err) {