@mbarlocker/date-curry
v0.0.4
Published
date-curry is a simple wrapper around the date-fns library to allow formatting and parsing of string dates.
Downloads
23
Maintainers
Readme
date-curry
Simplified date parsing and formatting from strings. This project wraps the parse
and format
functions of date-fns.
Installation
yarn add @mbarlocker/date-curry
Examples
import { curryDateFormat } from '@mbarlocker/date-curry'
const formats = curryDateFormat('P p')
const now = new Date().toISOString() // it'd be easier to use a date here, but imagine you got this date string from an API
console.log('Current time in current locale is', formats.format(now))
console.log('Current time in date format is', formats.parse(now))
License
Copyright © 2023-present Matthew Barlocker.
@mbarlocker/date-curry is licensed under the MIT License. See LICENSE for the full license text.