mirror of
https://github.com/plausible/analytics.git
synced 2024-12-24 01:54:34 +03:00
Fix arrows on year period
This commit is contained in:
parent
7f58e6be4e
commit
f9ab9ef980
@ -89,6 +89,9 @@ export function isBefore(date1, date2, period) {
|
||||
if (date1.getFullYear() !== date2.getFullYear()) {
|
||||
return date1.getFullYear() < date2.getFullYear();
|
||||
}
|
||||
if (period === "year") {
|
||||
return false;
|
||||
}
|
||||
if (date1.getMonth() !== date2.getMonth()) {
|
||||
return date1.getMonth() < date2.getMonth();
|
||||
}
|
||||
@ -103,6 +106,9 @@ export function isAfter(date1, date2, period) {
|
||||
if (date1.getFullYear() !== date2.getFullYear()) {
|
||||
return date1.getFullYear() > date2.getFullYear();
|
||||
}
|
||||
if (period === "year") {
|
||||
return false;
|
||||
}
|
||||
if (date1.getMonth() !== date2.getMonth()) {
|
||||
return date1.getMonth() > date2.getMonth();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user