amsul / amsul/pickadate.js

Date picker can't display well when on click

Aperta
#1,241 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
7.6k
Fork
981
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

When click on the date picker, it sometimes flash but did not popup. It seem showed but immediately close down. Would like to know how to solve this.

/*html*/
```


From Date:





To Date:




```

/*jquery*/
$(document).ready(function() {
/*date picker*/
/*from date*/
var from_$input = $('#fromDate').pickadate(),
from_picker = from_$input.pickadate('picker')

/*to date*/
var to_$input = $('#toDate').pickadate(),
to_picker = to_$input.pickadate('picker')

// Check if there’s a “from” or “to” date to start with.
if ( from_picker.get('value') ) {
to_picker.set('min', from_picker.get('select'))
}
if ( to_picker.get('value') ) {
from_picker.set('max', to_picker.get('select'))
}

// When something is selected, update the “from” and “to” limits.
from_picker.on('set', function(event) {
if ( event.select ) {
to_picker.set('min', from_picker.get('select'))
}
else if ( 'clear' in event ) {
to_picker.set('min', false)
}
})
to_picker.on('set', function(event) {
if ( event.select ) {
from_picker.set('max', to_picker.get('select'))
}
else if ( 'clear' in event ) {
from_picker.set('max', false)
}
})

});

function getTime(value){
if (value == 'start') {
currentStart = $('#fromDate').val() +' 00:00:00';
}else if(value == 'end') {
currentEnd = $('#toDate').val() +' 23:59:59';
}

}

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.