Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

erpnext date difference client script

},
out_time: function(frm) {
	console.log("in time and out time",frm.doc.in_time,frm.doc.out_time);
	total = frm.doc.out_time - frm.doc.in_time;
	console.log("Total time ",typeof(total));
	var start = moment(frm.doc.in_time, "HH:mm");
	console.log(start._i);
var end = moment(frm.doc.out_time, "HH:mm");
var minutes = end.diff(start, 'minutes');
	console.log(minutes);
var hours = Math.trunc(minutes/60);
	var m1 = minutes%60;
	var total_t = hours + ":" + m1;
	console.log(total_t);
	total_time = total_t;
	console.log(typeof(total_time));
	refresh_field('total_time');
}
Source by discuss.erpnext.com #
 
PREVIOUS NEXT
Tagged: #erpnext #date #difference #client #script
ADD COMMENT
Topic
Name
1+5 =