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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc (+9 lines)
Lines 122-127 Link Here
122
                }
122
                }
123
            }
123
            }
124
        },
124
        },
125
        onOpen: function( selectedDates, dateText, instance) {
126
            var thisInput = instance.input;
127
            let set_to_today = $(thisInput).data('flatpickr-set-to-today');
128
            if ( set_to_today ) {
129
                if ( thisInput.value === '' ) {
130
                    instance.setDate( new Date() );
131
                }
132
            }
133
        },
125
        onClose: function( selectedDates, dateText, instance) {
134
        onClose: function( selectedDates, dateText, instance) {
126
            validate_date( dateText, instance );
135
            validate_date( dateText, instance );
127
            var thisInput = instance.input;
136
            var thisInput = instance.input;
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc (-3 / +2 lines)
Lines 167-175 Link Here
167
                            <textarea id="[%- mv.id | html -%]" name="[% kohafield | html %]" class="input_marceditor [% kohafield | html %]" rows="5" cols="64" >[% mv.value | html %]</textarea>
167
                            <textarea id="[%- mv.id | html -%]" name="[% kohafield | html %]" class="input_marceditor [% kohafield | html %]" rows="5" cols="64" >[% mv.value | html %]</textarea>
168
                        [% END %]
168
                        [% END %]
169
                    [% ELSIF ( mv.type == 'date_field' ) %]
169
                    [% ELSIF ( mv.type == 'date_field' ) %]
170
                         <input type="text" id="[% mv.id | html %]" name="[% kohafield | html %]" class="input_marceditor [% kohafield | html %] flatpickr" value="[% mv.value | html %]" class="flatpickr" />
170
                         <input type="text" id="[% mv.id | html %]" name="[% kohafield | html %]" class="input_marceditor [% kohafield | html %] flatpickr" value="[% mv.value | html %]" class="flatpickr" data-flatpickr-set-to-today="true" />
171
                    [% ELSIF ( mv.type == 'datetime_field' ) %]
171
                    [% ELSIF ( mv.type == 'datetime_field' ) %]
172
                         <input type="text" id="[% mv.id | html %]" name="[% kohafield | html %]" class="input_marceditor [% kohafield | html %] flatpickr" value="[% mv.value | html %]" data-flatpickr-enable-time="true" />
172
                         <input type="text" id="[% mv.id | html %]" name="[% kohafield | html %]" class="input_marceditor [% kohafield | html %] flatpickr" value="[% mv.value | html %]" data-flatpickr-enable-time="true" data-flatpickr-set-to-today="true" />
173
                    [% END %]
173
                    [% END %]
174
174
175
                    [% IF subfield.kohafield == 'items.more_subfields_xml' %]
175
                    [% IF subfield.kohafield == 'items.more_subfields_xml' %]
176
- 

Return to bug 37398