@snickbit/dates
v1.0.80
Published
Extended Date and Time functionality for Dayjs
Downloads
13
Readme
@snickbit/dates
Extended Date and Time functionality for Dayjs
Installation
yarn add @snickbit/dates
npm add @snickbit/dates
Usage
import {dates} from '@snickbit/dates'
console.log(dates('2022-01-15').shortdate()) // '01/15/2022'
console.log(dates('2022-01-15').shorttime()) // '12:00 am'
// more quick presets in the docs
const duration = dates.duration(2500)
console.log(duration.humanize()) // 'a few seconds' - normal Dayjs duration output
console.log(duration.toWords()) // '2s and 500ms' - extended output
console.log(duration.toWords(true)) // '2 seconds' - consult the docs for more options
Documentation
API Docs
CHANGELOG
License
Copyright (c) 2022 - Nicholas Lowe aka Snickbit