javascript - How to get the first and last date of the previous week? -
I'm trying to get the first and last date of last week . My code gets the first and last date of the current week
var curr = new date; Var First Day = New Date (curr.setDate (curr.getDate () - curr.getDay ())); Var Last Day = New Date (curr.setDate (curr.getDate () - curr.getDay () + 6));
The program that you run will only start the last week and end dates .
var date = new date (); Var Dummy = Date.GetDay (); Dummy = Dummy + 7; Date.setDate (date.getDate () - dummy); Warning ("Last Day First Day:" + date); Date.setDate (date.getDate (+6); Warning ("last week last day:" + date);
Best of luck.
Comments
Post a Comment