mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-23 07:59:10 +00:00
@@ -96,12 +96,15 @@ export class Timer {
|
|||||||
|
|
||||||
// get current time in epoc
|
// get current time in epoc
|
||||||
_getCurrentTime() {
|
_getCurrentTime() {
|
||||||
// date today at midnight
|
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const midnight = new Date(now).setHours(0, 0, 0);
|
|
||||||
|
|
||||||
// return diffence
|
// extract milliseconds since midnight
|
||||||
return now - midnight;
|
let elapsed = now.getHours() * 3600000;
|
||||||
|
elapsed += now.getMinutes() * 60000;
|
||||||
|
elapsed += now.getSeconds() * 1000;
|
||||||
|
elapsed += now.getMilliseconds();
|
||||||
|
|
||||||
|
return elapsed;
|
||||||
}
|
}
|
||||||
|
|
||||||
_getExpectedFinish() {
|
_getExpectedFinish() {
|
||||||
|
|||||||
Reference in New Issue
Block a user