JSFiddle - React, Tailwind, and code Playground

by Swapnil Khamkar

JavaScript

var myMonth="September 2015" 
myMonth = "1 "+myMonth;

var d = new Date(myMonth);
alert(d.getDate()); // will give the start date of the month


var checkDate = new Date(myMonth);
var d1 = new Date(checkDate.getFullYear(), checkDate.getMonth() + 1, 0);
alert(d1.getDate()); // this will return the last date of the month