UNPKG

1.37 kBTypeScriptView Raw
1import { CalendarAngularDateFormatter } from './calendar-angular-date-formatter.provider';
2/**
3 * 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>.
4 *
5 * If you wish, you may override any of the defaults via angulars DI. For example:
6 *
7 * ```typescript
8 * import { CalendarDateFormatter, DateFormatterParams } from 'angular-calendar';
9 * import { formatDate } from '@angular/common';
10 * import { Injectable } from '@angular/core';
11 *
12 * @Injectable()
13 * class CustomDateFormatter extends CalendarDateFormatter {
14 *
15 * public monthViewColumnHeader({date, locale}: DateFormatterParams): string {
16 * return formatDate(date, 'EEE', locale); // use short week days
17 * }
18 *
19 * }
20 *
21 * // in your component that uses the calendar
22 * providers: [{
23 * provide: CalendarDateFormatter,
24 * useClass: CustomDateFormatter
25 * }]
26 * ```
27 */
28export declare class CalendarDateFormatter extends CalendarAngularDateFormatter {
29}