[英]extend jquery-ui-datepicker with a new option
Need your help here. 在这里需要您的帮助。
I'm trying to figure out how to properly extend datepicker with new option. 我试图弄清楚如何使用新选项正确扩展datepicker。 For example I want the "setDate" option.
例如,我想要“ setDate”选项。
Here how should it look like: 这里看起来应该是这样的:
$('#datepicker').datepicker({
setDate: function(){
return new Date().getTime(); // or any timestamp value
}
});
As a result my datepicker should be initialized this date value by default. 因此,默认情况下,我的日期选择器应初始化此日期值。
I know that I simply can do: 我知道我可以做到:
var curr_date = new Date().getTime();
$('#datepicker').datepicker('setDate', curr_date);
But what I really want is to extend a datepicker with a custom option. 但是我真正想要的是使用自定义选项扩展 datepicker。
Did you give a look at this SO question ? 您是否看过这个SO问题 ? It seems that could be useful to your cause.
看来这可能对您的事业有用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.