cdate-locale
v0.0.2
Published
I18N display handlers for cdate
Downloads
63
Maintainers
Readme
cdate-locale - I18N display handlers for cdate
SYNOPSIS
// TypeScript, ESM
import {cdate} from "cdate";
import {locale_en} from "cdate-locale";
// CommonJS
const {cdate} = require("cdate");
const {locale_fr} = require("cdate-locale");
const {locale_de} = require("cdate-locale/locale/de.js");
cdate().handler(locale_en).format("MMMM")
// => 'December'
cdate().handler(locale_en).text("%c");
// => 'Mon, Dec 12, 2022, 7:26:12 PM'
cdate().handler(locale_fr).format("MMMM")
// => 'décembre'
cdate().handler(locale_fr).text("%c");
// => 'lun. 12 déc. 2022, 19:26:12'
cdate().handler(locale_de).format("MMMM")
// => 'Dezember'
cdate().handler(locale_de).text("%c");
// => Mo., 12. Dez. 2022, 19:26:12'
LOCALES
- Find the list of the bundled locales at index.d.ts or locales.yml
LINKS
- https://github.com/kawanet/cdate
- https://github.com/kawanet/cdate-locale
- https://www.npmjs.com/package/cdate-locale