mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 16:34:46 +00:00
Merge pull request #43930 from lbrandh/fix_timestrings
fix: use get_datetime_as_string with correct time format
This commit is contained in:
@@ -356,7 +356,7 @@ var calculate_end_time = function (frm, cdt, cdn) {
|
|||||||
if (child.hours) {
|
if (child.hours) {
|
||||||
d.add(child.hours, "hours");
|
d.add(child.hours, "hours");
|
||||||
frm._setting_hours = true;
|
frm._setting_hours = true;
|
||||||
frappe.model.set_value(cdt, cdn, "to_time", d.format(frappe.defaultDatetimeFormat)).then(() => {
|
frappe.model.set_value(cdt, cdn, "to_time", frappe.datetime.get_datetime_as_string(d)).then(() => {
|
||||||
frm._setting_hours = false;
|
frm._setting_hours = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ erpnext.timesheet.control_timer = function (frm, dialog, row, timestamp = 0) {
|
|||||||
let d = moment(row.from_time);
|
let d = moment(row.from_time);
|
||||||
if (row.expected_hours) {
|
if (row.expected_hours) {
|
||||||
d.add(row.expected_hours, "hours");
|
d.add(row.expected_hours, "hours");
|
||||||
row.to_time = d.format(frappe.defaultDatetimeFormat);
|
row.to_time = frappe.datetime.get_datetime_as_string(d);
|
||||||
}
|
}
|
||||||
frm.refresh_field("time_logs");
|
frm.refresh_field("time_logs");
|
||||||
frm.save();
|
frm.save();
|
||||||
@@ -117,8 +117,7 @@ erpnext.timesheet.control_timer = function (frm, dialog, row, timestamp = 0) {
|
|||||||
grid_row.doc.project = args.project;
|
grid_row.doc.project = args.project;
|
||||||
grid_row.doc.task = args.task;
|
grid_row.doc.task = args.task;
|
||||||
grid_row.doc.expected_hours = args.expected_hours;
|
grid_row.doc.expected_hours = args.expected_hours;
|
||||||
grid_row.doc.hours = currentIncrement / 3600;
|
grid_row.doc.to_time = frappe.datetime.get_datetime_as_string();
|
||||||
grid_row.doc.to_time = frappe.datetime.now_datetime();
|
|
||||||
grid_row.refresh();
|
grid_row.refresh();
|
||||||
frm.dirty();
|
frm.dirty();
|
||||||
frm.save();
|
frm.save();
|
||||||
|
|||||||
Reference in New Issue
Block a user