Skip to content

Commit

Permalink
Add "set global locale" example to setDefaultOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
leshakoss committed Jul 22, 2022
1 parent 6d8e424 commit 277fcc5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/setDefaultOptions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ import requiredArgs from '../_lib/requiredArgs/index'
* @throws {TypeError} 1 argument required
*
* @example
* // Set global locale:
* import { es } from 'date-fns/locale'
* setDefaultOptions({ locale: es })
* const result = format(new Date(2014, 8, 2), 'PPPP')
* //=> 'martes, 2 de septiembre de 2014'
*
* @example
* // Start of the week for 2 September 2014:
* const result = startOfWeek(new Date(2014, 8, 2))
* //=> Sun Aug 31 2014 00:00:00
Expand Down

0 comments on commit 277fcc5

Please sign in to comment.