1.0.0 • Published 6 months ago

@procore/labs-date-formatter v1.0.0

Weekly downloads
906
License
SEE LICENSE IN LI...
Repository
github
Last release
6 months ago

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