build in some buffer for the midnight switch to historic traces

This commit is contained in:
Matthias Wirth
2020-06-22 18:01:26 +02:00
parent 15985a2480
commit 13ac3c1929

View File

@@ -4463,8 +4463,8 @@ function getTrace(newPlane, hex, options) {
if (showTrace) {
let today = new Date();
//console.log(today.toUTCString() + ' ' + traceDate.toUTCString());
// use non historic traces for showTrace until 20 min after midnight
if (today.getTime() > traceDate.getTime() && today.getTime() < traceDate.getTime() + (24 * 60 * 60 + 20 * 60) * 1000) {
// use non historic traces for showTrace until 30 min after midnight
if (today.getTime() > traceDate.getTime() && today.getTime() < traceDate.getTime() + (24 * 60 * 60 + 30 * 60) * 1000) {
today.setUTCHours(0);
today.setUTCMinutes(0);