我想根据日期选择器中的日期使用以下方案更改div的文本
DatePicker字段......
<input type="text" name="orderTime" class="" id="orderTime" value="" autocomplete="off" /><br><br>
<script type="text/javascript">
jQuery("#orderTime").datepicker({
changeMonth: true,
changeYear: false,
dateFormat: 'dd/mm/yy',
firstDay: 1,
duration: 'fast',
maxDate: '+2m',
minDate: '-0d',
numberOfMonths: 1
});
</script>
答案 0 :(得分:2)
使用DatePicker的 OnSelect 选项
<强>脚本强>
<script type="text/javascript">
jQuery("#orderTime").datepicker({
changeMonth: true,
changeYear: false,
dateFormat: 'dd/mm/yy',
firstDay: 1,
duration: 'fast',
maxDate: '+2m',
minDate: '-0d',
numberOfMonths: 1,
onSelect: function (selectDate){
// write your logic here
if(today) // today logic
alert('today')
else if(tomorrow) // tomorrow logic
alert('tomorrow')
}
});
</script>