@procore/labs-date-formatter
v1.0.0
Published
I18n Date Formatter
Downloads
660
Maintainers
Keywords
Readme
Date Formatter
Package for handling date formatting that accounts for Procore's unique locale types, and to render dates in React.
Installation
yarn add @procore/labs-date-formatter
Usage
import { dateFormatter } from "@procore/labs-date-formatter";
const { format } = dateFormatter(locale ?? navigator.language, options);
const formattedDate = format(new Date());
locale
: can come from the window object or a Procore environment provider
options
: object for how the date is to be formatted, see Using Options