在jquery Datepicker的minDate中传递时间戳值
我无法将时间戳字符串传递到minDate属性。我这样做似乎不管用 var时间戳=134980200000在jquery Datepicker的minDate中传递时间戳值,jquery,datepicker,timestamp,mindate,Jquery,Datepicker,Timestamp,Mindate,我无法将时间戳字符串传递到minDate属性。我这样做似乎不管用 var时间戳=134980200000 $( "booksale_start_date_view" ).datepicker( "option", "minDate", new Date(timestamp) ); 这样做对吗?对不起,我对这个问题一无所知。像这样试试 var timestamp=new Date(); //Unix Timestamp in seconds //But we need the time
$( "booksale_start_date_view" ).datepicker( "option", "minDate", new Date(timestamp) );
这样做对吗?对不起,我对这个问题一无所知。像这样试试
var timestamp=new Date(); //Unix Timestamp in seconds
//But we need the time in milliseconds so,
timestamp=timestamp*1000;
$("booksale_start_date_view" ).datepicker( "option", "minDate", timestamp);
假设您使用的是jQuery UI,您应该这样设置:
$( "#booksale_start_date_view" ).datepicker({ minDate: new Date(1349802000000)});
如果您提供了JSFIDLE,就更容易看出哪里出了问题。我已经从ajax准备好了时间戳字符串。我不能像你在这里描述的那样创建一个新的。@MihaRekar