Forum Discussion
_anomDiebolt_
8 years agoQrew Elite
If you wand to display the Duration field it will only be valid if the timer is stopped and you need to reload the page when stopped to display the correct value.
$("a.QBU_Stop").on("click", function(event) {
var rid = this.dataset.rid;
$('a.QBU_Start[data-rid=${rid}]').css("visibility", "visible");
$('a.QBU_Stop[data-rid=${rid}]').css("visibility", "hidden");
clocks[rid].stop();
var lastsavedtime = clocks[rid].getTime().time;
$.post(dbidTimers, {
act: "API_EditRecord",
rid: rid,
_fid_8: parseInt(new Date().getTime(), 10) / 1000,
_fid_10: lastsavedtime
}).then(function() {
document.location.reload(true);
});
});