Get last day of month from specific date

September 12th, 2015 Javascript 1,628 views

Let’s say we have given any date and we want to find out on what day of week the Month ends using Javascript. E.g. 09-12-2015 (12th sept 2015), the last day of this month is Wednesday. So our script should return 3 which is Wednesday counting from Sunday as 0, Monday as 1, Tuesday as 2 & so on.

Here is the script that I made :

And day_of_week will have the last day of the month.

Leave your comments: