chore: Ingnore issues

This commit is contained in:
Deepesh Garg
2023-07-23 19:34:08 +05:30
parent 8ccb8e3c5b
commit 0d70ae2a21
5 changed files with 27 additions and 26 deletions

View File

@@ -344,6 +344,28 @@ frappe.ui.form.on('Job Card', {
if(frm.doc.__islocal)
return;
function setCurrentIncrement() {
currentIncrement += 1;
return currentIncrement;
}
function updateStopwatch(increment) {
var hours = Math.floor(increment / 3600);
var minutes = Math.floor((increment - (hours * 3600)) / 60);
var seconds = increment - (hours * 3600) - (minutes * 60);
$(section).find(".hours").text(hours < 10 ? ("0" + hours.toString()) : hours.toString());
$(section).find(".minutes").text(minutes < 10 ? ("0" + minutes.toString()) : minutes.toString());
$(section).find(".seconds").text(seconds < 10 ? ("0" + seconds.toString()) : seconds.toString());
}
function initialiseTimer() {
const interval = setInterval(function() {
var current = setCurrentIncrement();
updateStopwatch(current);
}, 1000);
}
frm.dashboard.refresh();
const timer = `
<div class="stopwatch" style="font-weight:bold;margin:0px 13px 0px 2px;
@@ -365,28 +387,6 @@ frappe.ui.form.on('Job Card', {
currentIncrement += moment(frappe.datetime.now_datetime()).diff(moment(frm.doc.started_time),"seconds");
initialiseTimer();
}
function initialiseTimer() {
const interval = setInterval(function() {
var current = setCurrentIncrement();
updateStopwatch(current);
}, 1000);
}
function updateStopwatch(increment) {
var hours = Math.floor(increment / 3600);
var minutes = Math.floor((increment - (hours * 3600)) / 60);
var seconds = increment - (hours * 3600) - (minutes * 60);
$(section).find(".hours").text(hours < 10 ? ("0" + hours.toString()) : hours.toString());
$(section).find(".minutes").text(minutes < 10 ? ("0" + minutes.toString()) : minutes.toString());
$(section).find(".seconds").text(seconds < 10 ? ("0" + seconds.toString()) : seconds.toString());
}
function setCurrentIncrement() {
currentIncrement += 1;
return currentIncrement;
}
}
},