To use the previousSaturday
function from date-fns:
index.tsx21 chars2 lines
previousSaturday
function in your Javascript file:index.tsx50 chars2 lines
index.tsx264 chars4 lines
The previousSaturday
function returns a new Date object representing the date of the previous Saturday relative to the input date. If the input date is a Saturday, it returns the same date.
gistlibby LogSnag