UNPKG

922 BJavaScriptView Raw
1import { getDefaultOptions as getInternalDefaultOptions } from "./_lib/defaultOptions.mjs";
2
3/**
4 * @name getDefaultOptions
5 * @category Common Helpers
6 * @summary Get default options.
7 * @pure false
8 *
9 * @description
10 * Returns an object that contains defaults for
11 * `options.locale`, `options.weekStartsOn` and `options.firstWeekContainsDate`
12 * arguments for all functions.
13 *
14 * You can change these with [setDefaultOptions](https://date-fns.org/docs/setDefaultOptions).
15 *
16 * @returns The default options
17 *
18 * @example
19 * const result = getDefaultOptions()
20 * //=> {}
21 *
22 * @example
23 * setDefaultOptions({ weekStarsOn: 1, firstWeekContainsDate: 4 })
24 * const result = getDefaultOptions()
25 * //=> { weekStarsOn: 1, firstWeekContainsDate: 4 }
26 */
27export function getDefaultOptions() {
28 return Object.assign({}, getInternalDefaultOptions());
29}
30
31// Fallback for modularized imports:
32export default getDefaultOptions;