JSPM

messageformat-date-skeleton

0.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 29
  • Score
    100M100P100Q85268F
  • License MIT

A parser & formatter for ICU DateFormat skeleton strings

Package Exports

  • messageformat-date-skeleton

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (messageformat-date-skeleton) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

messageformat-date-skeleton

Tools for working with ICU DateFormat skeletons.

import {
  DateFormatError,
  DateToken,
  getDateFormatter,
  getDateFormatterSource,
  parseDateTokens
} from 'messageformat-date-skeleton'

Classes

Class Description
DateFormatError Parent class for errors.

Functions

Function Description
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 (value: number) => string signature as the function returned by getDateFormatter().
parseDateTokens(src) Parse an ICU DateFormat skeleton string into a DateToken array.

Type Aliases

Type Alias Description
DateToken An object representation of a parsed date skeleton token

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

OpenJS Foundation