Right now, I have this on my page:
I have read the given answer and this is what I came out with. Note that I started from the answer of @pimvdb
// return an array composed of a list of the days' number
// from 1 month ago until today, not included
function getAllDays() {
var e = moment();
var s = moment().subtract('months', 1);
var a = []
// While the updated start date is older, perform the loop.
while(s.isBefore(e)) {
// Update the format according to moment js documentations format().
a.push(s.format("MMM - DD"));
s = s.add('days', 1);
}
return a;
}
Simply call the function anywhere in your code:
getAllDays();
see also: MomentJs library