火狐浏览器 js 1到9月份 new DATE不返回时间

new Date('2016-1'); //错误 1到9月份必须 01 02 。。。。。

正确 new Date('2016-01');

 

 var nowMonth = nowMonth>=10 ? nowMonth : '0'+nowMonth; //兼容火狐

 

 

posted @ 2016-11-25 10:53  太菜  阅读(208)  评论(0编辑  收藏  举报