From cf31d281340f0187c500af60679ea6a03eb0cf94 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20-=20Le=20Filament?= <remi@le-filament.com>
Date: Tue, 26 Dec 2023 11:03:26 +0100
Subject: [PATCH] [FIX] disable arrows if dates are also before/after limits

---
 static/src/js/canvas.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/static/src/js/canvas.js b/static/src/js/canvas.js
index 8fb92d7..7d23f3b 100644
--- a/static/src/js/canvas.js
+++ b/static/src/js/canvas.js
@@ -669,12 +669,12 @@ odoo.define("oacc_portal_overview_cdc.canvas", function (require) {
             }
 
             // Disable buttons if first or last date
-            if (this.last_day == this.maxDate) {
+            if (this.last_day >= this.maxDate) {
                 $('button[id="next-period"]').prop("disabled", true);
             } else {
                 $('button[id="next-period"]').prop("disabled", false);
             }
-            if (this.first_day == this.minDate) {
+            if (this.first_day <= this.minDate) {
                 $('button[id="previous-period"]').prop("disabled", true);
             } else {
                 $('button[id="previous-period"]').prop("disabled", false);
-- 
GitLab