fix: timezone aware SLA banner (backport #38745) (#38746)

fix: timezone aware SLA banner (#38745)

(cherry picked from commit eaf86a6461)

Co-authored-by: Ankush Menat <ankush@frappe.io>
This commit is contained in:
mergify[bot]
2023-12-14 15:59:19 +05:30
committed by GitHub
parent f6c611d026
commit 73d525e84d

View File

@@ -971,7 +971,7 @@ function set_time_to_resolve_and_response(frm, apply_sla_for_resolution) {
}
function get_time_left(timestamp, agreement_status) {
const diff = moment(timestamp).diff(moment());
const diff = moment(timestamp).diff(frappe.datetime.system_datetime(true));
const diff_display = diff >= 44500 ? moment.duration(diff).humanize() : 'Failed';
let indicator = (diff_display == 'Failed' && agreement_status != 'Fulfilled') ? 'red' : 'green';
return {'diff_display': diff_display, 'indicator': indicator};