[hotfix] fixed 'ValueError: Unknown string format' error if the from_time value is null (#11162)

This commit is contained in:
Makarand Bauskar 2017-10-18 11:16:47 +05:30 committed by Nabin Hait
parent 5ab6ff2470
commit 3e4ca4219f

View File

@ -159,9 +159,14 @@ frappe.ui.form.on("Timesheet Detail", {
});
var calculate_end_time = function(frm, cdt, cdn) {
var child = locals[cdt][cdn];
let child = locals[cdt][cdn];
var d = moment(child.from_time);
if(!child.from_time) {
// if from_time value is not available then set the current datetime
frappe.model.set_value(cdt, cdn, "from_time", frappe.datetime.get_datetime_as_string());
}
let d = moment(child.from_time);
if(child.hours) {
d.add(child.hours, "hours");
frm._setting_hours = true;