import TemporalCompiler from "ts-time-format/TemporalCompiler";
Interface of date/time-related type string compiler. Compiler defines a way to format a single component of a pattern defined as a sequence of same text characters. For example, "dd" sequence calls:
DAY_OF_MONTH_COMPILER.compile(date, 2);
Some character sequences write textual language-dependent strings. To handle such cases, context should be passed to the compiler:
const context = { monthShortNames: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] }; MONTH_COMPILER.compile(date, 3, context); // writes short name of a month, same as "MMM" sequence
If no context is passed, DEFAULT_TEMPORAL_CONTEXT representing English localization is being used.
readonly maxLength: number
(value: T, length: number, context: any = DEFAULT_TEMPORAL_CONTEXT): string