I have 2 buttons( Previous and next ) for week. In between the previous and next week button needs to show week ending date (Fridays) for that week.
I want to display previous week date from Sun 11/18 to Mon 11/26 when we click the previous week button. Same as the next week button click event to show from Mon 11/26″ to Sun 12/2.
How it possible to show? and how to take the week ending date (Fridays) for that week?
I have 2 buttons( Previous and next ) for week. In between the previous
Share
This’s to get the date in 7 days, and from 7 days ago:
If you don’t want a timestamp returned, remove the
Date.parse()from it to receive a string like this:(This was returned on a system with Dutch language settings)
To get the week dates, take a look at these 2 questions:
JavaScript – get the first day of the week from current date
How to get first and last day of the week in JavaScript