Want to calculate check-in time & check-out time

Hello experts,
I want to calculate check-in time & check-out time.
the result in total is not showing up, please help & advise.

My Script Is :

frappe.ui.form.on(“Times”, {

check_in_btn: function(frm){
	check_in_time(frm);
},
check_out_btn: function(frm){
	check_out_time(frm);
}

});

var check_in_time = function(frm)
{
frm.set_value(“check_in”, frappe.datetime.now_time());
}
var check_out_time = function(frm)
{
frm.set_value(“check_out”, frappe.datetime.now_time());
frm.set_value(“total”, frm.doc.check_out - frm.doc.check_in);
}

Doctype Is :

Result Is :

I know time is a String data type thats why its not calculating.
but please provide any solution for this.

use frappe.datetime.add_days

Where to put this code in my script?
please provide little more details.

I think frappe.datetime.add_days is for date.
i need time calculation boy.
i want to calculate difference between check in & check out time.

@erpnext
Is there nobody to help me up?
i am very disappointed with your services.
my multiple posts are pending because no one is replying me.
please close the forum because none of your guys are here to help someone.

@shah welcome to open source! This is a voluntary forum and no one is paid here to answer your questions. Also seems you are building features and not contributing them either.

I checked your profile. You have asked 33 questions but not answered even one. I am sure there are some questions you can answer. So maybe build a good reputation of helping others before you need help. I hope you have your answer.

7 Likes