The startOfISOWeek
function from the date-fns library is used to get the start of the ISO week of a given date. Here's how you can use it:
index.tsx21 chars2 lines
startOfISOWeek
function in your javascript file like this:index.tsx43 chars2 lines
startOfISOWeek
function to get the start of the ISO week of a date. Here's an example:index.tsx150 chars4 lines
In the example above, we create a new date object for August 10th, 2021 at 11:10 PM. We then pass this date to the startOfISOWeek
function which returns the start of the ISO week for this date (which is August 9th, 2021 at 12:00 AM).
gistlibby LogSnag