You can use the nextWednesday
function from date-fns
to find the next Wednesday from a specified date.
Here is an example code block showing how to use the nextWednesday
function:
265 chars7 lines
In this code block, we import the nextWednesday
function from date-fns
. We then create a Date
object set to Wednesday, Nov 3 2021, and pass it to the nextWednesday
function to get the next Wednesday from this date. The output will be the Date object for Wednesday, Nov 10 2021.
gistlibby LogSnag