我有一个简单的日期选择器文本字段:
<input type="text" name="book_on" id="book_on" value="<?php echo $today; ?>"
jQuery如下:
$('#book_on').datepicker({
dateFormat: 'mm/dd/y'
});
This is all very straight-forward, but I also need to show the chosen date in a different format elsewhere on the page - specifically, when a date is chosen, I need to show which day of the week it is in a <span>
on the page .
这将是dateFormat: 'D'
但我找不到让日期选择器返回第二种日期格式的方法。我不需要编写整个代码,如果您可以使用上面的函数来提醒所选日期的星期几,那就太好了。