From f9ab9ef980deebd775af30b7fd165cdfffb11de0 Mon Sep 17 00:00:00 2001 From: Uku Taht Date: Thu, 31 Mar 2022 13:56:56 +0300 Subject: [PATCH] Fix arrows on year period --- assets/js/dashboard/util/date.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/assets/js/dashboard/util/date.js b/assets/js/dashboard/util/date.js index eb94e1174..bb913f0cf 100644 --- a/assets/js/dashboard/util/date.js +++ b/assets/js/dashboard/util/date.js @@ -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(); }