mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Uses now proper toLocaleString function
This commit is contained in:
parent
66f33b368b
commit
df39a9a1ff
9 changed files with 22 additions and 22 deletions
|
@ -909,13 +909,13 @@ import { appRouter } from '../appRouter';
|
|||
}
|
||||
|
||||
if (options.showYear || options.showSeriesYear) {
|
||||
const productionYear = item.ProductionYear?.toLocaleString(getCurrentDateTimeLocale(), {useGrouping: false});
|
||||
const productionYear = datetime.toLocaleString(item.ProductionYear, {useGrouping: false});
|
||||
if (item.Type === 'Series') {
|
||||
if (item.Status === 'Continuing') {
|
||||
lines.push(globalize.translate('SeriesYearToPresent', productionYear || ''));
|
||||
} else {
|
||||
if (item.EndDate && item.ProductionYear) {
|
||||
const endYear = datetime.parseISO8601Date(item.EndDate).getFullYear().toLocaleString(getCurrentDateTimeLocale(), {useGrouping: false});
|
||||
const endYear = datetime.toLocaleString(datetime.parseISO8601Date(item.EndDate).getFullYear(), {useGrouping: false});
|
||||
lines.push(productionYear + ((endYear === item.ProductionYear) ? '' : (' - ' + endYear)));
|
||||
} else {
|
||||
lines.push(productionYear || '');
|
||||
|
|
|
@ -122,7 +122,7 @@ import template from './imageDownloader.template.html';
|
|||
html += '<span style="margin-right: 10px;">';
|
||||
|
||||
const startAtDisplay = totalRecordCount ? startIndex + 1 : 0;
|
||||
html += globalize.translate('ListPaging', startAtDisplay.toLocaleString(), recordsEnd.toLocaleString(), totalRecordCount.toLocaleString());
|
||||
html += globalize.translate('ListPaging', startAtDisplay, recordsEnd, totalRecordCount);
|
||||
|
||||
html += '</span>';
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ import itemHelper from '../itemHelper';
|
|||
import '../../elements/emby-progressbar/emby-progressbar';
|
||||
import './indicators.scss';
|
||||
import 'material-design-icons-iconfont';
|
||||
import { getCurrentDateTimeLocale } from '../../scripts/globalize';
|
||||
|
||||
export function enableProgressIndicator(item) {
|
||||
if (item.MediaType === 'Video' && item.Type !== 'TvChannel') {
|
||||
|
@ -84,7 +85,7 @@ export function getPlayedIndicatorHtml(item) {
|
|||
if (enablePlayedIndicator(item)) {
|
||||
const userData = item.UserData || {};
|
||||
if (userData.UnplayedItemCount) {
|
||||
return '<div class="countIndicator indicator">' + userData.UnplayedItemCount.toLocaleString() + '</div>';
|
||||
return '<div class="countIndicator indicator">' + datetime.toLocaleString(userData.UnplayedItemCount) + '</div>';
|
||||
}
|
||||
|
||||
if (userData.PlayedPercentage && userData.PlayedPercentage >= 100 || (userData.Played)) {
|
||||
|
@ -99,7 +100,7 @@ export function getChildCountIndicatorHtml(item, options) {
|
|||
const minCount = options && options.minCount ? options.minCount : 0;
|
||||
|
||||
if (item.ChildCount && item.ChildCount > minCount) {
|
||||
return '<div class="countIndicator indicator">' + item.ChildCount.toLocaleString() + '</div>';
|
||||
return '<div class="countIndicator indicator">' + datetime.toLocaleString(item.ChildCount) + '</div>';
|
||||
}
|
||||
|
||||
return '';
|
||||
|
|
|
@ -111,8 +111,6 @@ import '../../elements/emby-button/emby-button';
|
|||
|
||||
const showFolderRuntime = item.Type === 'MusicAlbum' || item.MediaType === 'MusicArtist' || item.Type === 'Playlist' || item.MediaType === 'Playlist' || item.MediaType === 'MusicGenre';
|
||||
|
||||
const dateTimeLocale = getCurrentDateTimeLocale();
|
||||
|
||||
if (showFolderRuntime) {
|
||||
count = item.SongCount || item.ChildCount;
|
||||
|
||||
|
@ -177,13 +175,13 @@ import '../../elements/emby-button/emby-button';
|
|||
|
||||
if (options.year !== false && item.ProductionYear && item.Type === 'Series') {
|
||||
if (item.Status === 'Continuing') {
|
||||
miscInfo.push(globalize.translate('SeriesYearToPresent', item.ProductionYear.toLocaleString(dateTimeLocale, {useGrouping: false})));
|
||||
miscInfo.push(globalize.translate('SeriesYearToPresent', datetime.toLocaleString(item.ProductionYear, {useGrouping: false})));
|
||||
} else if (item.ProductionYear) {
|
||||
text = item.ProductionYear.toLocaleString(dateTimeLocale, {useGrouping: false});
|
||||
text = datetime.toLocaleString(item.ProductionYear, {useGrouping: false});
|
||||
|
||||
if (item.EndDate) {
|
||||
try {
|
||||
const endYear = datetime.parseISO8601Date(item.EndDate).getFullYear().toLocaleString(dateTimeLocale, {useGrouping: false});
|
||||
const endYear = datetime.toLocaleString(datetime.parseISO8601Date(item.EndDate).getFullYear(), {useGrouping: false});
|
||||
|
||||
if (endYear !== item.ProductionYear) {
|
||||
text += `-${endYear}`;
|
||||
|
@ -247,7 +245,7 @@ import '../../elements/emby-button/emby-button';
|
|||
miscInfo.push(item.ProductionYear);
|
||||
} else if (item.PremiereDate) {
|
||||
try {
|
||||
text = datetime.parseISO8601Date(item.PremiereDate).getFullYear().toLocaleString(dateTimeLocale, {useGrouping: false});
|
||||
text = datetime.toLocaleString(datetime.parseISO8601Date(item.PremiereDate).getFullYear(), {useGrouping: false});
|
||||
miscInfo.push(text);
|
||||
} catch (e) {
|
||||
console.error('error parsing date:', item.PremiereDate);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue