Skip to content
Snippets Groups Projects
Commit f9ab9ef9 authored by Uku Taht's avatar Uku Taht
Browse files

Fix arrows on year period

parent 7f58e6be
Branches
No related tags found
No related merge requests found
......@@ -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();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment