mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-11-01 00:10:12 +01:00
Fix Today/Yesterday wrong with negative timezones
Applied offset to "now" when comparing with offset timestamps. Affects issues: - Possibly fixed #3420
This commit is contained in:
parent
701866cc6a
commit
12cf9ea414
@ -28,11 +28,11 @@ export function formatDate(date, offset, pattern, recentDays, recentDaysPattern,
|
|||||||
|
|
||||||
let format = pattern;
|
let format = pattern;
|
||||||
if (recentDays) {
|
if (recentDays) {
|
||||||
if (timestamp > now - fromStartOfToday) {
|
if (timestamp > now - offset - fromStartOfToday) {
|
||||||
format = format.replace(recentDaysPattern, t('plugin.generic.today'));
|
format = format.replace(recentDaysPattern, t('plugin.generic.today'));
|
||||||
} else if (timestamp > now - dayMs - fromStartOfToday) {
|
} else if (timestamp > now - offset - dayMs - fromStartOfToday) {
|
||||||
format = format.replace(recentDaysPattern, t('plugin.generic.yesterday'));
|
format = format.replace(recentDaysPattern, t('plugin.generic.yesterday'));
|
||||||
} else if (timestamp > now - dayMs * 5) {
|
} else if (timestamp > now - offset - dayMs * 5) {
|
||||||
format = format.replace(recentDaysPattern, "EEEE");
|
format = format.replace(recentDaysPattern, "EEEE");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user