I had a project where I had to get a date range based on year and week number. After quick Google around I couldn’t find anything good at that time, so I decided to write a small function myself.
Function takes two parameters Year and Week number and returns two results First Day of a Week and a Last Day of a Week.
For example: if we take date 2019 and a week number 2, function will return two dates 2019-01-07 and 2019-01-13.
You can modify as you with and hopefully it will helps to achieve what you need.
Copy to Clipboard
Leave A Comment