aboutsummaryrefslogtreecommitdiff
path: root/Functions
diff options
context:
space:
mode:
authorJoel Kronqvist <work.joelkronqvist@gmail.com>2022-11-18 18:27:40 +0200
committerJoel Kronqvist <work.joelkronqvist@gmail.com>2022-11-18 18:27:40 +0200
commitd10272298acb4d6e07fb5b73dd7af06d653afd7b (patch)
tree7031c0edd2a64edbfb69958e099fcbcf929bbf36 /Functions
parent5665f993de41b82ab24c4a546d442b18f0bda4d3 (diff)
downloadLYLLRuoka-d10272298acb4d6e07fb5b73dd7af06d653afd7b.tar.gz
LYLLRuoka-d10272298acb4d6e07fb5b73dd7af06d653afd7b.zip
Updated exam/vacation/etc notifications.
Now they don't block the search field, which is more user friendly. They also appear only if the date searched for matches the notification, not if the current date matches the notification.
Diffstat (limited to 'Functions')
-rw-r--r--Functions/dateFuncs.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/Functions/dateFuncs.js b/Functions/dateFuncs.js
index 340b46e..caec1c9 100644
--- a/Functions/dateFuncs.js
+++ b/Functions/dateFuncs.js
@@ -5,14 +5,14 @@ function stringToDate(s) {
}
const isBetweenDates = (date, date1, date2) => {
- date = approxDate(date);
- date1 = approxDate(date1);
- date2 = approxDate(date2);
+ date = floorDate(date);
+ date1 = floorDate(date1);
+ date2 = floorDate(date2);
return ((date.getTime() >= date1.getTime())
&& (date.getTime() <= date2.getTime()));
};
-function approxDate(d)
+function floorDate(d)
{
return new Date(`${d.getFullYear()}-${(d.getMonth() + 1).toString().padStart(2, "0")}-${d.getDate().toString().padStart(2, "0")}`);
}