jquery ui datepicker set tomorrows date as default

让人想犯罪 __ 提交于 2019-12-11 05:29:29

问题


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

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


回答1:


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




回答2:


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

minDate: +1


来源:https://stackoverflow.com/questions/6831679/jquery-ui-datepicker-set-tomorrows-date-as-default

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!