jquery ui datepicker set tomorrows date as default

2019-08-01 09:35发布

I think I'm missing something pretty straight forward here..

How do you set the default date on the jqueryui to tomorrow ?

2条回答
疯言疯语
2楼-- · 2019-08-01 10:08

Initialize a datepicker with the defaultDate option specified.

    $( ".selector" ).datepicker({ defaultDate: +1 });

Get or set the defaultDate option, after init.

    //getter
    var defaultDate = $( ".selector" ).datepicker( "option", "defaultDate" );
    //setter
    $( ".selector" ).datepicker( "option", "defaultDate", +1 );

see: http://jqueryui.com/demos/datepicker/#option-defaultDate

查看更多
相关推荐>>
3楼-- · 2019-08-01 10:14

Or if your don't want back dates then you can use as this while initialzing the datepicker

minDate: +1
查看更多
登录 后发表回答