Fehler bei NaN nochmal überarbeitet

This commit is contained in:
holger.trampe 2021-03-26 14:47:05 +01:00
parent a7764977f5
commit 7fce2a1664
2 changed files with 7 additions and 12 deletions

View File

@ -159,13 +159,7 @@ Gleitzeitkonto:
else{ else{
now = new Date(); now = new Date();
viewtime = now - starttime_view - breaktime; viewtime = now - starttime_view - breaktime;
$("#realtimeclock").html(convertMS(viewtime));
if(isNaN(viewtime)){
location.href = location.href;
}
else{
$("#realtimeclock").html(convertMS(viewtime));
}
} }
} }
@ -221,9 +215,9 @@ Gleitzeitkonto:
}, },
success: function( data ) success: function( data )
{ {
// TODO: Hier ist anscheinend der Fehler der zu NaN:NaN usw. führt! Sollte jetzt passen!
//console.log("break end add " + data["actualbreaktime"]);
breaktime = data["actualbreaktime"]; breaktime = data["actualbreaktime"];
startbreaktime_view = data["actualbreaktime"];
starttime_view = Date.parse(data["wdtime"]);
$("#breaksum").html(convertMS(data["actualbreaktime"])); $("#breaksum").html(convertMS(data["actualbreaktime"]));
} }
}); });

View File

@ -663,7 +663,8 @@ def TimeAjax(request):
data = { data = {
"success" : True, "success" : True,
"actualbreaktime" : breaksum*1000 "actualbreaktime" : breaksum*1000,
"wdtime" : wd.start
} }
# REMOVE WORKDAY # REMOVE WORKDAY
elif request.GET["action"] == "remove_workday": elif request.GET["action"] == "remove_workday":