How to get Start Date and End Date in Last month using Javascripts.
For an example:
Today - 09/07/2013
I need to get output
Last month start date: 01/06/2013 Last month end date: 30/06/2013
How to get Start Date and End Date in Last month using Javascripts.
For an example:
Today - 09/07/2013
I need to get output
Last month start date: 01/06/2013 Last month end date: 30/06/2013
function f()
{
var date = new Date();
var firstDay = new Date(date.getFullYear(), date.getMonth()-1, 1);
var lastDay = new Date(date.getFullYear(), date.getMonth(), 0);
alert(firstDay+"==="+lastDay);
}