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