From d459d16f2d517d861528cfec099e8733c28b6b40 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 2 Jun 2023 09:10:13 +0200 Subject: [PATCH] Bug 33132: [22.05.x] Add date_to_rfc3339 Signed-off-by: Lucas Gass --- koha-tmpl/intranet-tmpl/prog/en/includes/js-date-format.inc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/js-date-format.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/js-date-format.inc index 3dae094b8d..f395e463fe 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/js-date-format.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/js-date-format.inc @@ -67,6 +67,12 @@ return m.format(get_time_pattern(timeformat)+(dateformat=='rfc3339'?':ss'+(!m.isUTC()?'Z':''):''))+(dateformat=='rfc3339' && m.isUTC()?'Z':''); } + window.$date_to_rfc3339 = function(value, options) { + var dateformat = (options&&options.dateformat)||def_date_format; + let m = moment(value, get_date_pattern(dateformat)); + return m.format("YYYY-MM-DD"); + } + })(); -- 2.39.5