mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
fix yesterday labels
This commit is contained in:
parent
870c5e2f2d
commit
06f03fdbf3
5 changed files with 22 additions and 12 deletions
|
@ -104,7 +104,7 @@
|
|||
}();
|
||||
|
||||
function toLocaleDateString(date) {
|
||||
|
||||
|
||||
var currentLocale = globalize.getCurrentLocale();
|
||||
|
||||
return currentLocale && toLocaleTimeStringSupportsLocales ?
|
||||
|
@ -160,10 +160,20 @@
|
|||
return time;
|
||||
}
|
||||
|
||||
function isRelativeDay(date, offsetInDays) {
|
||||
var yesterday = new Date();
|
||||
var day = yesterday.getDate() + offsetInDays;
|
||||
|
||||
yesterday.setDate(day); // automatically adjusts month/year appropriately
|
||||
|
||||
return date.getFullYear() == yesterday.getFullYear() && date.getMonth() == yesterday.getMonth() && date.getDate() == day;
|
||||
}
|
||||
|
||||
return {
|
||||
parseISO8601Date: parseISO8601Date,
|
||||
getDisplayRunningTime: getDisplayRunningTime,
|
||||
toLocaleDateString: toLocaleDateString,
|
||||
getDisplayTime: getDisplayTime
|
||||
getDisplayTime: getDisplayTime,
|
||||
isRelativeDay: isRelativeDay
|
||||
};
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue