从jquery ui datepicker maxDate选项获取日期对象
通过使用以下
var maxDate = $( ".selector" ).datepicker( "option", "maxDate" );
输出可以是'+ 1M','+ 20Y','12 / 12 / 2013年以上..
The output can be anything from '+1M','+20Y', '12/12/2013' or more..
+ 1M& '+ 20Y'示例可以使用本机JavaScript添加到当前日期,以便我能够获得实际的日期对象。
Are the '+1M' & '+20Y' examples something that can be used with native javascript to add to the current date so I'd be able to get an actual date object?
我想使用它来验证一组预设使用的以下功能(当前周,月,日等)
I would like to use this to validate the following function that is used by a set of presets (Current Week, Month, Day etc)
function SetDate(dateFrom, dateTo) {
$('.dateFrom').attr('value', dateFrom);
$('.dateTo').attr('value', dateTo);
}
一个href =http://stackoverflow.com/a/2886384/151625>这个jQuery datepicker getMinDate+ 1d'的答案
After a bit more searching I found this answer to "jQuery datepicker getMinDate '+1d'"
我决定使用用户发布的第二个例子:
I decided to use the second example the user posted:
var minDateAttr = $(elem).datepicker("option", "minDate");
var inst = $(elem).data("datepicker");
var minDateObj = $.datepicker._determineDate(inst, minDateAttr, new Date());