Fix/58 roll issues (#67)

* fix/58-roll-issues: handle edge cases
This commit is contained in:
Carlos Valente
2021-12-15 22:31:34 +01:00
committed by GitHub
parent 1321aa555e
commit cd911aaaa2
6 changed files with 129 additions and 35 deletions
+2 -5
View File
@@ -1,6 +1,6 @@
import { Timer } from './Timer.js';
import { Server } from 'socket.io';
import { getSelectionByRoll } from './classUtils.js';
import {DAYMS, getSelectionByRoll} from './classUtils.js';
/*
* EventTimer adds functions specific to APP
@@ -11,9 +11,6 @@ import { getSelectionByRoll } from './classUtils.js';
*/
export class EventTimer extends Timer {
// AUX
DAYMS = 86400000;
// Socket IO Object
io = null;
@@ -701,7 +698,7 @@ export class EventTimer extends Timer {
const start = e.timeStart == null || e.timeStart === '' ? 0 : e.timeStart;
let end = e.timeEnd == null || e.timeEnd === '' ? 0 : e.timeEnd;
// in case the end is earlier than start, we assume is the day after
if (end < start) end += this.DAYMS;
if (end < start) end += DAYMS;
// time stuff changes on wheter we keep the running clock