To use setDefaultOptions
function from date-fns
, you need to import it first from the package.
Here's how you can use it:
index.tsx153 chars10 lines
The setDefaultOptions
function will set the new default options for all functions that use the options
object in the date-fns
package. This way, you don't have to pass the options object every time you use a date-fns
function.
Note that the options
object follows the date-fns
option specification. For more information, you can check out the date-fns
documentation.
gistlibby LogSnag