View | Details | Raw Unified | Return to bug 24980
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/js-date-format.inc (-1 / +1 lines)
Lines 33-39 Link Here
33
        window.$date = function(value, options) {
33
        window.$date = function(value, options) {
34
            var tz = (options&&options.tz)||def_tz;
34
            var tz = (options&&options.tz)||def_tz;
35
            var m = moment(value);
35
            var m = moment(value);
36
            if(tz) m.tz(tz);
36
            if((m.creationData().format !== 'YYYY-MM-DD')&&tz) m.tz(tz);
37
37
38
            var dateformat = (options&&options.dateformat)||def_date_format;
38
            var dateformat = (options&&options.dateformat)||def_date_format;
39
            var withtime = (options&&options.withtime)||false;
39
            var withtime = (options&&options.withtime)||false;
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/js-date-format.inc (-3 / +8 lines)
Lines 24-33 Link Here
24
            return time_pattern;
24
            return time_pattern;
25
        };
25
        };
26
26
27
        /*
28
         * A JS equivilent of the KohaDates TT Plugin. Passed an rfc3339 formatted date string,
29
         * or JS Date, the function will return a date string formatted as per the koha instance config.
30
         * Optionally accepts a dateformat parameter to allow override of the configured output format
31
         * as well as a 'withtime' boolean denoting whether to include time or not in the output string.
32
         */
27
        window.$date = function(value, options) {
33
        window.$date = function(value, options) {
28
            var tz = (options&&options.tz)||def_tz;
34
            var tz = (options&&options.tz)||def_tz;
29
            var m = moment(value);
35
            var m = moment(value);
30
            if(tz) m.tz(tz);
36
            if((m.creationData().format !== 'YYYY-MM-DD')&&tz) m.tz(tz);
31
37
32
            var dateformat = (options&&options.dateformat)||def_date_format;
38
            var dateformat = (options&&options.dateformat)||def_date_format;
33
            var withtime = (options&&options.withtime)||false;
39
            var withtime = (options&&options.withtime)||false;
Lines 59-62 Link Here
59
        }
65
        }
60
66
61
    })();
67
    })();
62
</script>
68
</script>
63
- 

Return to bug 24980