Skip to content

pre-parse-post-format

Imported from yugajs/extension/pre-parse-post-format.

const preParsePostFormat: yuga.Extension<void>;

Day.js’s preParsePostFormat: string parsables go through the locale’s preparse (the config’s locale, or the global one), and format results through the instance’s locale’s postformat.

Intl locales have no such hooks (Intl formats native digits itself), register a locale object that has them. Unlike Day.js, fromNow and toNow (relativeTime) don’t apply postformat.