Backport pull request #6265 from jellyfin-web/release-10.10.z
Add support for plugin revisions with bad timestamps Original-merge: 71ab6fea5d2d43a45adce9fb7b92ce603d9b447d Merged-by: thornbill <thornbill@users.noreply.github.com> Backported-by: Joshua M. Boniface <joshua@boniface.me>
This commit is contained in:
committed by
Joshua M. Boniface
parent
4f17bfb5ed
commit
0ff58e81b0
+17
-1
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user