Bug 33703: Don't use Maskito when picking a range
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
25d8e9ee59
commit
173fedce31
|
|
@ -85,30 +85,36 @@
|
|||
onChange: function( selectedDates, dateText, instance) {
|
||||
var thisInput = instance.input;
|
||||
let accepts_time = $(thisInput).data('flatpickr-enable-time');
|
||||
if ( accepts_time ) {
|
||||
let parsedDate = flatpickr.parseDate(dateText, instance.config.dateFormat);
|
||||
if ( !parsedDate.getHours() ) {
|
||||
instance.setDate(selectedDates[0].setHours(23, 59, 0, 0));
|
||||
let accepts_period = $(thisInput).data('flatpickr-period');
|
||||
if ( !accepts_period ) {
|
||||
if ( accepts_time ) {
|
||||
let parsedDate = flatpickr.parseDate(dateText, instance.config.dateFormat);
|
||||
if ( !parsedDate.getHours() ) {
|
||||
instance.setDate(selectedDates[0].setHours(23, 59, 0, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
onOpen: function( selectedDates, dateText, instance ) {
|
||||
var thisInput = instance.input;
|
||||
let accepts_time = $(thisInput).data('flatpickr-enable-time');
|
||||
let accepts_period = $(thisInput).data('flatpickr-period');
|
||||
let options = {};
|
||||
if ( accepts_time ) {
|
||||
options = maskitoDateTimeOptionsGenerator({
|
||||
dateMode: altinput_dateformat,
|
||||
timeMode: 'HH:MM',
|
||||
dateSeparator: delimiter,
|
||||
});
|
||||
} else {
|
||||
options = maskitoDateOptionsGenerator({
|
||||
mode: altinput_dateformat,
|
||||
separator: delimiter,
|
||||
});
|
||||
if ( !accepts_period ) {
|
||||
if ( accepts_time ) {
|
||||
options = maskitoDateTimeOptionsGenerator({
|
||||
dateMode: altinput_dateformat,
|
||||
timeMode: 'HH:MM',
|
||||
dateSeparator: delimiter,
|
||||
});
|
||||
} else {
|
||||
options = maskitoDateOptionsGenerator({
|
||||
mode: altinput_dateformat,
|
||||
separator: delimiter,
|
||||
});
|
||||
}
|
||||
new Maskito( instance.altInput, options );
|
||||
}
|
||||
new Maskito( instance.altInput, options );
|
||||
},
|
||||
onClose: function( selectedDates, dateText, instance) {
|
||||
validate_date( dateText, instance );
|
||||
|
|
|
|||
Loading…
Reference in New Issue