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

Popular posts from this blog

asp.net - Procedure or function "Procedure name" expects a parameter "Param name" which was not supplied occurs rarely -

jsp - No mapping found for HTTP request with URI with annotation config Spring MVC and Jetty -

sql server ce - Is there some way to make sqlce3.5 and 4.0 co-exist in the C# project -