Skip to content

Commit

Permalink
优化 datePicker,默认选择当天 #196
Browse files Browse the repository at this point in the history
  • Loading branch information
BearJ committed Jul 20, 2018
1 parent f19eb33 commit 1828664
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/picker/picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -413,12 +413,15 @@ function picker() {
* });
*/
function datePicker(options) {
const nowDate = new Date();

const defaults = $.extend({
id: 'datePicker',
onChange: $.noop,
onConfirm: $.noop,
start: 2000,
end: 2030,
start: nowDate.getFullYear() - 20,
end: nowDate.getFullYear() + 20,
defaultValue: [nowDate.getFullYear(), nowDate.getMonth() + 1, nowDate.getDate()],
cron: '* * *'
}, options);

Expand Down

0 comments on commit 1828664

Please sign in to comment.