UNPKG

3.37 kBTypeScriptView Raw
1import { NgbDateStruct } from './ngb-date-struct';
2import * as i0 from "@angular/core";
3/**
4 * A service supplying i18n data to the datepicker component.
5 *
6 * The default implementation of this service uses the Angular locale and registered locale data for
7 * weekdays and month names (as explained in the Angular i18n guide).
8 *
9 * It also provides a way to i18n data that depends on calendar calculations, like aria labels, day, week and year
10 * numerals. For other static labels the datepicker uses the default Angular i18n.
11 *
12 * See the [i18n demo](#/components/datepicker/examples#i18n) and
13 * [Hebrew calendar demo](#/components/datepicker/calendars#hebrew) on how to extend this class and define
14 * a custom provider for i18n.
15 */
16export declare abstract class NgbDatepickerI18n {
17 /**
18 * Returns the weekday label using specified width
19 *
20 * @since 9.1.0
21 */
22 abstract getWeekdayLabel(weekday: number, width?: Exclude<Intl.DateTimeFormatOptions['weekday'], undefined>): string;
23 /**
24 * Returns the short month name to display in the date picker navigation.
25 *
26 * With default calendar we use ISO 8601: 'month' is 1=Jan ... 12=Dec.
27 */
28 abstract getMonthShortName(month: number, year?: number): string;
29 /**
30 * Returns the full month name to display in the date picker navigation.
31 *
32 * With default calendar we use ISO 8601: 'month' is 1=Jan ... 12=Dec.
33 */
34 abstract getMonthFullName(month: number, year?: number): string;
35 /**
36 * Returns the text label to display above the day view.
37 *
38 * @since 9.1.0
39 */
40 getMonthLabel(date: NgbDateStruct): string;
41 /**
42 * Returns the value of the `aria-label` attribute for a specific date.
43 *
44 * @since 2.0.0
45 */
46 abstract getDayAriaLabel(date: NgbDateStruct): string;
47 /**
48 * Returns the textual representation of a day that is rendered in a day cell.
49 *
50 * @since 3.0.0
51 */
52 getDayNumerals(date: NgbDateStruct): string;
53 /**
54 * Returns the textual representation of a week number rendered by datepicker.
55 *
56 * @since 3.0.0
57 */
58 getWeekNumerals(weekNumber: number): string;
59 /**
60 * Returns the textual representation of a year that is rendered in the datepicker year select box.
61 *
62 * @since 3.0.0
63 */
64 getYearNumerals(year: number): string;
65 /**
66 * Returns the week label to display in the heading of the month view.
67 *
68 * @since 9.1.0
69 */
70 getWeekLabel(): string;
71 static ɵfac: i0.ɵɵFactoryDeclaration<NgbDatepickerI18n, never>;
72 static ɵprov: i0.ɵɵInjectableDeclaration<NgbDatepickerI18n>;
73}
74/**
75 * A service providing default implementation for the datepicker i18n.
76 * It can be used as a base implementation if necessary.
77 *
78 * @since 9.1.0
79 */
80export declare class NgbDatepickerI18nDefault extends NgbDatepickerI18n {
81 private _locale;
82 private _monthsShort;
83 private _monthsFull;
84 getWeekdayLabel(weekday: number, width?: Exclude<Intl.DateTimeFormatOptions['weekday'], undefined>): string;
85 getMonthShortName(month: number): string;
86 getMonthFullName(month: number): string;
87 getDayAriaLabel(date: NgbDateStruct): string;
88 static ɵfac: i0.ɵɵFactoryDeclaration<NgbDatepickerI18nDefault, never>;
89 static ɵprov: i0.ɵɵInjectableDeclaration<NgbDatepickerI18nDefault>;
90}