i have js code which stacks div's that are represanting days in month in a larger div that is actually a calendar. user can freely select month and year and i need to build calendar for that month.
for example: if this month is starting with saturday i need to first build 5 empty blocks and then start filling calendar with blocks that have number of day inside them. how can i calculate this number for given input of month and year?