The variable now is now declared as a global variable at the beginning of draw.js and is assigned in drawClock(), based on the current ServerDate and a new global variable offset (in milliseconds). A new function has been added, devOverrideDate(date) with type signature Date | Number | String -> void, which constructs a Date object from the parameter and sets offset such that now is set to this Date object and counts onward. Additionally, all references to today have been replaced by references to now, as I see no need to maintain a separate variable for the client-side time. getStart() has been changed to construct a new Date object instead of using the mutable Date.prototype.setHours().
This PR closes #46.
The variable
now
is now declared as a global variable at the beginning of draw.js and is assigned indrawClock()
, based on the currentServerDate
and a new global variableoffset
(in milliseconds). A new function has been added,devOverrideDate(date)
with type signatureDate | Number | String -> void
, which constructs a Date object from the parameter and setsoffset
such thatnow
is set to this Date object and counts onward. Additionally, all references totoday
have been replaced by references tonow
, as I see no need to maintain a separate variable for the client-side time.getStart()
has been changed to construct a new Date object instead of using the mutableDate.prototype.setHours()
.