課程
/前端開發
/HTML/CSS
/DatePicker組件開發
比如 2017年 智能往上選 2018 。。。 不能選到 2016的
2017-10-20
源自:DatePicker組件開發
正在回答
datePicker.getMonthData = function (year,month) {
if(!year || !month){ ? ?if(month === 0 && year){ ? ? ? ?year --; ? ? ? ?month = 12; ? ?}else { ? ? ? ?var today = new Date(); ? ? ? ?year = today.getFullYear(); ? ? ? ?month = today.getMonth() + 1; ? ?} ? ?console.info(month);}
........
}
舉報
使用原生JS完成一個日期選擇器(datepicker)組件的開發
2 回答當月份到了一月份,再往前,怎么年分不變
1 回答切換月份的問題
2 回答暴力使用面向對象解決組件不能復用的問題,同時改進了一點樣式,供大家參考
1 回答Jquery創建節點問題
1 回答js這塊講的不太好理解,不知道是不是我基礎不扎實,有沒有這樣的學友呀
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2017-10-20
datePicker.getMonthData = function (year,month) {
if(!year || !month){
? ?if(month === 0 && year){
? ? ? ?year --;
? ? ? ?month = 12;
? ?}else {
? ? ? ?var today = new Date();
? ? ? ?year = today.getFullYear();
? ? ? ?month = today.getMonth() + 1;
? ?}
? ?console.info(month);
}
........
}