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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc (-8 / +17 lines)
Lines 84-90 Link Here
84
        },
84
        },
85
        onChange: function( selectedDates, dateText, instance) {
85
        onChange: function( selectedDates, dateText, instance) {
86
            var thisInput = instance.input;
86
            var thisInput = instance.input;
87
            let = accepts_time = $(thisInput).data('flatpickr-enable-time');
87
            let accepts_time = $(thisInput).data('flatpickr-enable-time');
88
            if ( accepts_time ) {
88
            if ( accepts_time ) {
89
                let parsedDate = flatpickr.parseDate(dateText, instance.config.dateFormat);
89
                let parsedDate = flatpickr.parseDate(dateText, instance.config.dateFormat);
90
                if ( !parsedDate.getHours() ) {
90
                if ( !parsedDate.getHours() ) {
Lines 93-103 Link Here
93
            }
93
            }
94
        },
94
        },
95
        onOpen: function( selectedDates, dateText, instance ) {
95
        onOpen: function( selectedDates, dateText, instance ) {
96
            let element = instance.altInput;
96
            var thisInput = instance.input;
97
            let options = maskitoDateOptionsGenerator({
97
            let accepts_time = $(thisInput).data('flatpickr-enable-time');
98
                mode: altinput_dateformat,
98
            let options = {};
99
                separator: delimiter,
99
            if ( accepts_time ) {
100
            });
100
                options = maskitoDateTimeOptionsGenerator({
101
                    dateMode: altinput_dateformat,
102
                    timeMode: 'HH:MM',
103
                    dateSeparator: delimiter,
104
                });
105
            } else {
106
                options = maskitoDateOptionsGenerator({
107
                    mode: altinput_dateformat,
108
                    separator: delimiter,
109
                });
110
            }
101
            new Maskito( instance.altInput, options );
111
            new Maskito( instance.altInput, options );
102
        },
112
        },
103
        onClose: function( selectedDates, dateText, instance) {
113
        onClose: function( selectedDates, dateText, instance) {
Lines 199-205 Link Here
199
        if ( $(input).data('flatpickr-enable-time') === true ) {
209
        if ( $(input).data('flatpickr-enable-time') === true ) {
200
            options['enableTime'] = true;
210
            options['enableTime'] = true;
201
            options['dateFormat'] = "Y-m-d H:i";
211
            options['dateFormat'] = "Y-m-d H:i";
202
            options['altFormat'] = flatpickr_dateformat_string + " " + flatpickr_timeformat_string;
212
            options['altFormat'] = flatpickr_dateformat_string + ", " + flatpickr_timeformat_string;
203
        }
213
        }
204
        if ( $(input).data('flatpickr-disable-shortcuts') === true ) {
214
        if ( $(input).data('flatpickr-disable-shortcuts') === true ) {
205
            options['plugins'] = [];
215
            options['plugins'] = [];
206
- 

Return to bug 33703