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")) {