9
我使用這個標記jQuery的日期選擇器 -
<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 };
但後來我如何添加/覆蓋從數據屬性值的。我只是不知道
謝謝您的幫助。 – Ivar