mydate97的时间格式设置

<script type="text/javascript" src="./WdatePicker.js"></script>
<script type="text/javascript">
function pickDate(){
    WdatePicker({startDate:'%y/%M/%d',dateFmt:'yyyy/MM/dd'});
}
function pickMonth(){
    WdatePicker({startDate:'%y/%M',dateFmt:'yyyy/MM'});
}

function change(val){
    document.getElementById("date").detachEvent('onclick',val=='day'? pickMonth:pickDate);
    document.getElementById('date').attachEvent('onclick',val=='day'? pickDate:pickMonth);
}
</script>

<select onchange='change(this.value)'>
    <option value='day'>日</option>
    <option value='month'>月</option>
</select>
<input type="text" value='' onclick='pickDate()' id="date"/>

你可能感兴趣的:(mydate97的时间格式设置)