From 45a127812b77b9ec1ed7d27bac1da3bc9e1f4eed Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 25 Mar 2020 13:40:04 +0000 Subject: [PATCH] Bug 24455: (follow-up) Document function This patch just adds some minimal documentation to the main exported JS function. Signed-off-by: Martin Renvoize --- .../intranet-tmpl/prog/en/includes/js-date-format.inc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 91a770a5a6..b567a86940 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 @@ -24,6 +24,12 @@ return time_pattern; }; + /* + * A JS equivilent of the KohaDates TT Plugin. Passed an rfc3339 formatted date string, + * or JS Date, the function will return a date string formatted as per the koha instance config. + * Optionally accepts a dateformat parameter to allow override of the configured output format + * as well as a 'withtime' boolean denoting whether to include time or not in the output string. + */ window.$date = function(value, options) { var tz = (options&&options.tz)||def_tz; var m = moment(value); @@ -59,4 +65,4 @@ } })(); - \ No newline at end of file + -- 2.39.5