From 501efacc5a5a28bf28d17c5eb294d51f64f2168f Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 25 Mar 2020 20:41:45 +0000 Subject: [PATCH] Bug 20936: (QA follow-up) Only add timezone if date-time This patch prevents a timezone from being assigned to the js moment if the input string is only at the full-date and not date-time resolution --- koha-tmpl/opac-tmpl/bootstrap/en/includes/js-date-format.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/js-date-format.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/js-date-format.inc index 9381684bc6..be53e0ba52 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/js-date-format.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/js-date-format.inc @@ -27,7 +27,7 @@ window.$date = function(value, options) { var tz = (options&&options.tz)||def_tz; var m = moment(value); - if(tz) m.tz(tz); + if((m.creationData.format !== 'YYYY-MM-DD')&&tz) m.tz(tz); var dateformat = (options&&options.dateformat)||def_date_format; var withtime = (options&&options.withtime)||false; @@ -59,4 +59,4 @@ } })(); - \ No newline at end of file + -- 2.20.1