From 29371163ad8efd0c3d7e0179046382d3d73e4fae Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Mon, 8 Nov 2021 21:38:19 +0100 Subject: [PATCH] Fixed night mode over midnight time range check (fixes #1673) --- changelog/65_UNRELEASED_xxxx-xx-xx.md | 1 + public/js/grocy_nightmode.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/changelog/65_UNRELEASED_xxxx-xx-xx.md b/changelog/65_UNRELEASED_xxxx-xx-xx.md index e1c2a585..d0e7a549 100644 --- a/changelog/65_UNRELEASED_xxxx-xx-xx.md +++ b/changelog/65_UNRELEASED_xxxx-xx-xx.md @@ -2,3 +2,4 @@ - The default shopping list (named "Shopping list"; localized) can now be renamed - Fixed that the "Stay logged in permanently" checkbox on the login page had no effect (thanks @0) - Fixed that the labels of context-/more-menu items were not readable in Night Mode (thanks @corbolais) +- Fixed that auto night mode over midnight did not always work diff --git a/public/js/grocy_nightmode.js b/public/js/grocy_nightmode.js index d4fc8c9a..61368026 100644 --- a/public/js/grocy_nightmode.js +++ b/public/js/grocy_nightmode.js @@ -89,7 +89,7 @@ function CheckNightMode() end.add(1, "day"); } - if (start.isSameOrBefore(now) && end.isSameOrAfter(now)) // We're INSIDE of night mode time range + if (now.isBetween(start, end)) // We're INSIDE of night mode time range { if (!$("body").hasClass("night-mode")) {