/date-format

Format dates

Primary LanguageTypeScriptMIT LicenseMIT

🌙 @ricardojrmcom/date-format

Format dates

build license

author

lang version size




Install

npm install @ricardojrmcom/date-format

yarn add @ricardojrmcom/date-format

Usage

import { dateFormat, dateRelative } from '@ricardojrmcom/date-format'

dateFormat(new Date('2022-01-31'))
-> '12:00 AM - 31 Jan, 2022 GMT'

dateRelative(new Date('2022-01-31'))
->  {
      from: '2 months ago',
      fromNow: 'in 2 months',
      to: 'in 2 months',
      toNow: '2 months ago',
    }




License

MIT © Ricardo <l1b3r_-> Mota (@ricardojrmcom)

Bootstrapped with 🟪@ricardojrmcom/nova