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

Optimize loading of date-fns

This commit is contained in:
Bill Thornton 2022-11-03 00:52:12 -04:00
parent 88a01888bf
commit b3febe49ad
4 changed files with 97 additions and 74 deletions

View file

@ -2,8 +2,8 @@ import escapeHtml from 'escape-html';
import Events from '../utils/events.ts';
import globalize from '../scripts/globalize';
import dom from '../scripts/dom';
import * as datefns from 'date-fns';
import dfnshelper from '../scripts/dfnshelper';
import { formatRelative } from 'date-fns';
import { getLocale } from '../scripts/dfnshelper';
import serverNotifications from '../scripts/serverNotifications';
import '../elements/emby-button/emby-button';
import './listview/listview.scss';
@ -38,7 +38,7 @@ import { toBoolean } from '../utils/string.ts';
html += escapeHtml(entry.Name);
html += '</div>';
html += '<div class="listItemBodyText secondary">';
html += datefns.formatRelative(Date.parse(entry.Date), Date.parse(new Date()), { locale: dfnshelper.getLocale() });
html += formatRelative(Date.parse(entry.Date), Date.now(), { locale: getLocale() });
html += '</div>';
html += '<div class="listItemBodyText secondary listItemBodyText-nowrap">';
html += escapeHtml(entry.ShortOverview || '');