mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Backport pull request #6265 from jellyfin-web/release-10.10.z
Add support for plugin revisions with bad timestamps
Original-merge: 71ab6fea5d
Merged-by: thornbill <thornbill@users.noreply.github.com>
Backported-by: Joshua M. Boniface <joshua@boniface.me>
This commit is contained in:
parent
4f17bfb5ed
commit
0ff58e81b0
2 changed files with 19 additions and 3 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue