开发者

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 });
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜