From a551660d2a92abb655a573141a378afee5502e29 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 14 Dec 2023 15:59:21 +0530 Subject: [PATCH] fix: timezone aware SLA banner (backport #38745) (#38747) fix: timezone aware SLA banner (#38745) (cherry picked from commit eaf86a6461438720fe941100d6feccefbfa3bfed) Co-authored-by: Ankush Menat --- erpnext/public/js/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/public/js/utils.js b/erpnext/public/js/utils.js index e9d06dfbec2c..b0ea56833b7f 100755 --- a/erpnext/public/js/utils.js +++ b/erpnext/public/js/utils.js @@ -1077,7 +1077,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};