Added a function for detecting if the site is within a certain timespan
This commit is contained in:
parent
1c17531016
commit
2bad728b68
3
time.js
3
time.js
|
@ -21,7 +21,8 @@ function parse(timestr) {
|
||||||
|
|
||||||
//Function for parsing and checking if the currrent time is within the parsed string.
|
//Function for parsing and checking if the currrent time is within the parsed string.
|
||||||
function within_timespan(timespan) {
|
function within_timespan(timespan) {
|
||||||
|
if (get() > parse(timespan)[0] && get() < parse(timespan)[1]) return true;
|
||||||
|
else return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function during_school() {
|
function during_school() {
|
||||||
|
|
Loading…
Reference in a new issue