Socket
Socket
Sign inDemoInstall

@messageformat/date-skeleton

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @messageformat/date-skeleton

A parser & formatter for ICU DateFormat skeleton strings


Version published
Weekly downloads
358K
increased by1.49%
Maintainers
1
Install size
26.3 kB
Created
Weekly downloads
 

Readme

Source

@messageformat/date-skeleton

Tools for working with ICU DateFormat skeletons.

import {
  DateFormatError,
  DateToken, // TS only
  getDateFormatter,
  getDateFormatterSource,
  parseDateTokens
} from '@messageformat/date-skeleton';

The package is released as an ES module only. If using from a CommonJS context, you may need to import() it, or use a module loader like esm.

Uses Intl.DateTimeFormat internally. Position-dependent ICU DateFormat patterns are not supported, as they cannot be represented with Intl.DateTimeFormat options.

Classes

ClassDescription
DateFormatErrorParent class for errors.

Functions

FunctionDescription
getDateFormatter(locales, tokens, onError)Returns a date formatter function for the given locales and date skeleton
getDateFormatterSource(locales, tokens, onError)Returns a string of JavaScript source that evaluates to a date formatter function with the same (date: Date | number) => string signature as the function returned by getDateFormatter().
parseDateTokens(src)Parse an ICU DateFormat skeleton string into a DateToken array.

Type Aliases

Type AliasDescription
DateTokenAn object representation of a parsed date skeleton token

Messageformat is an OpenJS Foundation project, and we follow its Code of Conduct.

OpenJS Foundation

Keywords

FAQs

Last updated on 16 Jul 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc