• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// generated by diplomat-tool
2import type { Calendar } from "./Calendar"
3import type { DataProvider } from "./DataProvider"
4import type { Date } from "./Date"
5import type { DateTimeFormatError } from "./DateTimeFormatError"
6import type { DateTimeFormatterLoadError } from "./DateTimeFormatterLoadError"
7import type { DateTimeLength } from "./DateTimeLength"
8import type { IsoDate } from "./IsoDate"
9import type { Locale } from "./Locale"
10import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
11
12
13/** An ICU4X DateFormatter object capable of formatting a [`Date`] as a string,
14*using some calendar specified at runtime in the locale.
15*
16*See the [Rust documentation for `DateTimeFormatter`](https://docs.rs/icu/latest/icu/datetime/struct.DateTimeFormatter.html) for more information.
17*
18*Additional information: [1](https://docs.rs/icu/latest/icu/datetime/fieldsets/struct.YMD.html)
19*/
20
21
22export class DateFormatter {
23
24    get ffiValue(): pointer;
25
26    static createWithLength(locale: Locale, length: DateTimeLength): DateFormatter;
27
28    static createWithLengthAndProvider(provider: DataProvider, locale: Locale, length: DateTimeLength): DateFormatter;
29
30    format(value: Date): string;
31
32    formatIso(value: IsoDate): string;
33
34    calendar(): Calendar;
35}