intl-datetimeformat
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

intl-datetimeformat

A simple wrapper around Intl.DateTimeFormat.

Install

npm install intl-datetimeformat

Use

import { createFormat } from "intl-datetimeformat"

const format = createFormat("en", { dateStyle: "medium", timeStyle: "medium" })

const str = format(date) // date can be a Date object, timestamp, or ISO string.

Reuse locale

import { createPartial } from "intl-datetimeformat"

// Format dates in German.
const createFormat = createPartial("de")

const format = createFormat({ dateStyle: "medium", timeStyle: "medium" })

const str = format(date)

Readme

Keywords

none

Package Sidebar

Install

npm i intl-datetimeformat

Weekly Downloads

18

Version

1.0.0

License

MIT

Unpacked Size

10.3 kB

Total Files

12

Last publish

Collaborators

  • ilyasemenov