how to set the minimum date for JQuery datepicker retrieved from model
$('#bid_work_end_date').datepicker(
{
dateFormat: 'dd-mm-yy',
minDate: -0
});
In this code, i have set the开发者_StackOverflow中文版 min date as today's date but i want to set it by retrieving from a rails model. I cannot find out a way to do it??
try this
var oDate=new Date();
var day=oDate.getDate();
var month=oDate.getMonth()+1;
var year=oDate.getFullYear();
var new_date=day+"-"+month+"-"+year;
$('#bid_work_end_date').datepicker( { dateFormat: 'dd-mm-yy', minDate: new_date });
精彩评论