localized-format
Imported from yugajs/extension/localized-format.
Variables
Section titled “Variables”localizedFormat
Section titled “localizedFormat”const localizedFormat: () => void;Day.js’s localizedFormat: the LT, LTS, L, LL, LLL and LLLL tokens, and their short
forms (l, ll, lll, llll), in formatting and parsing.
enhas Day.js’s templates, other locales’ come fromIntl(dateStyleandtimeStyle), with 4-digit years. A locale’sformatswin.- Parsing (with
yugajs/extension/custom-parse-format, installed before or after) expands the tokens in the format first throughyuga.$.parseFormat, the same as Day.js’scustomParseFormat. The weekday names ofLLLLare checked by its weekday tokens (unknown names are invalid).
import { localizedFormat } from "yugajs/extension/localized-format";
yuga.extend(localizedFormat);yuga("2024-05-15T10:20").format("LLL"); // "May 15, 2024 10:20 AM"Returns
Section titled “Returns”void
templateFor
Section titled “templateFor”const templateFor: (locale, token) => string;The template of a token in a locale: its own formats, en’s, or Intl’s. A short form is its
long one with shorter names and numbers, the same as Day.js. Built once per locale and token.
Used by yugajs/extension/locale-data (longDateFormat).
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
locale |
yuga.Locale |
token |
string |
Returns
Section titled “Returns”string