1
0
Fork 0
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:
Luke Pulverenti 2016-08-25 00:53:12 -04:00
parent 870c5e2f2d
commit 06f03fdbf3
5 changed files with 22 additions and 12 deletions

View file

@ -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
};
});