amsul / amsul/pickadate.js

Date picker can't display well when on click

未關閉
#1,241 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
JavaScript
星號
7.6k
分支
981
PR 合併指標
30 天內沒有已合併 PR

描述

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';
}

}

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。