I´m looking for a method, which returns all days of a given month. I couldn’t find anything helpful at the standard date() functions.
i.e.:
getDays(2010-05) // returns something like:
{ day:'Saturday', date:'2010-01-05' },
{ day:'Sunday', date:'2010-02-05' },
{ day:'Monday', date:'2010-03-05' }[...]
Just the day of the first day of the month may (saturday, 01) and the last (monday, 31) would be great, too.
You can do this yourself pretty easily. The Javascript “Date” object is a great help for things like this:
That only returns the days in the month numerically, but it’d be easy to extend with an array of day-of-week names: