这是当前的日期,即今天的日期
var currentDate = new Date();
我们说今天的日期是Sat Mar 21 2015 17:19:15 GMT+0530
。我使用以下代码
var monthNames = ["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"];
var month = monthNames[currentTime.getMonth()];
在我的情况下,月份= MAR
根据当前month
,我想按照从month-12
到当月MAR
的递增顺序创建最近12个月的数组。如果当前月份为MAR
date = ["APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC","JAN","FEB","MAR"];
如何根据当前日期获取动态数组?
提前致谢