1 | import { CalendarAngularDateFormatter } from '../calendar-angular-date-formatter/calendar-angular-date-formatter.provider';
|
2 | import * as i0 from "@angular/core";
|
3 | /**
|
4 | * This class is responsible for all formatting of dates. There are 3 implementations available, the `CalendarAngularDateFormatter` (default) which uses the angular date pipe to format dates, the `CalendarNativeDateFormatter` which will use the <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Intl" target="_blank">Intl</a> API to format dates, or there is the `CalendarMomentDateFormatter` which uses <a href="http://momentjs.com/" target="_blank">moment</a>.
|
5 | *
|
6 | * If you wish, you may override any of the defaults via angulars DI. For example:
|
7 | *
|
8 | * ```typescript
|
9 | * import { CalendarDateFormatter, DateFormatterParams } from 'angular-calendar';
|
10 | * import { formatDate } from '@angular/common';
|
11 | * import { Injectable } from '@angular/core';
|
12 | *
|
13 | * @Injectable()
|
14 | * class CustomDateFormatter extends CalendarDateFormatter {
|
15 | *
|
16 | * public monthViewColumnHeader({date, locale}: DateFormatterParams): string {
|
17 | * return formatDate(date, 'EEE', locale); // use short week days
|
18 | * }
|
19 | *
|
20 | * }
|
21 | *
|
22 | * // in your component that uses the calendar
|
23 | * providers: [{
|
24 | * provide: CalendarDateFormatter,
|
25 | * useClass: CustomDateFormatter
|
26 | * }]
|
27 | * ```
|
28 | */
|
29 | export declare class CalendarDateFormatter extends CalendarAngularDateFormatter {
|
30 | static ɵfac: i0.ɵɵFactoryDeclaration<CalendarDateFormatter, never>;
|
31 | static ɵprov: i0.ɵɵInjectableDeclaration<CalendarDateFormatter>;
|
32 | }
|