Simplified date parsing and formatting from strings. This project wraps the parse
and format
functions of date-fns.
yarn add @mbarlocker/date-curry
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))
Copyright © 2023-present Matthew Barlocker.
@mbarlocker/date-curry is licensed under the MIT License. See LICENSE for the full license text.