The lastDayOfQuarter
function from the date-fns
library can be used to get the last day of a quarter. Here is an example:
index.tsx175 chars7 lines
In this example, we are requiring the lastDayOfQuarter
function from the date-fns
library. We then create a new instance of the Date
object and pass it to the lastDayOfQuarter
function. This returns the last day of the quarter for the specified date.
The lastDayOfQuarter
function also accepts an optional options
object as its second parameter, which allows you to specify the start day of the week and the locale to use.
gistlibby LogSnag