我想制作一些 Javascript 代码来查找截至当前日期的所有日期。
这是我到目前为止所拥有的:
var titleArray = [
"title1",
"title2",
];
var pictureArray = today.toString();
var thumbArray = today.toString();
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth()+1; //January is 0!
var yyyy = today.getFullYear();
if(dd<10) {
dd='0'+dd
}
if(mm<10) {
mm='0'+mm
}
today = yyyy+'_'+mm+'_'+dd;
$.each(titleArray, function(i, val) {
$(".dailySection").append('<a href="images/daily/'+pictureArray+'.jpg" title="'+val+'"><img src="images/thumbs/'+thumbArray+'.jpg"></a>');
});
如何在 Javascript 中创建日期数组?