Skip to content

Commit

Permalink
example updtae
Browse files Browse the repository at this point in the history
  • Loading branch information
dolymood committed Feb 14, 2019
1 parent 7f934d9 commit 6bc9be0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ <h1>date-time-picker examples</h1>
var datePicker = new DateTimePicker.Date({
lang: 'zh-CN',
default: date.value,
min: '2015-08-10',
max: '2017-11-20'
min: '2018-01-01',
max: '2025-12-31'
})
datePicker.on('selected', function (formatDate, now) {
console.log('selected date: ', formatDate, now)
Expand Down
9 changes: 5 additions & 4 deletions src/panel/days.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,12 @@ function checkInrange (parsedCurrent, parsedMin, parsedMax) {
}

function checkDisabled (date, parsedCurrent, parsedMin, parsedMax) {
var disabled = false
if (parsedCurrent.year === parsedMin.year && parsedCurrent.month === parsedMin.month) {
return date < parsedMin.date
disabled = date < parsedMin.date
}
if (parsedCurrent.year === parsedMax.year && parsedCurrent.month === parsedMax.month) {
return date > parsedMax.date
if (!disabled && parsedCurrent.year === parsedMax.year && parsedCurrent.month === parsedMax.month) {
disabled = date > parsedMax.date
}
return false
return disabled
}

0 comments on commit 6bc9be0

Please sign in to comment.