【发布时间】:2023-04-06 09:53:02
【问题描述】:
我正在使用这个标记
<label> Date <input type="text" data-datepicker="{maxDate: '+1d'}" /></label>
<label> Another date <input type="text" data-datepicker="" /></label>
<script>
$('[data-datepicker]').each(function() {
// init the options var with some default values (dateFormat etc)
// that can be overridden by the data-datepicker values
// also, new values can be added to the options from data-datepicker
// such as in the above example "maxDate"
var options = TODO;
$(this).datepicker(options);
});
</script>
我真的不知道从那个选项对象开始.. 从默认值开始似乎是一个好的开始
var options = { dateFormat: 'yy-mm-dd };
但是我如何添加/覆盖数据属性中的值..我只是不知道
【问题讨论】:
标签: jquery jquery-ui jquery-ui-datepicker custom-data-attribute