UNPKG

angular-calendar

Version:

A calendar component that can display events on a month, week or day view

27 lines (26 loc) 1.19 kB
import { CalendarNativeDateFormatter } from './calendarNativeDateFormatter.provider'; /** * This class is responsible for all formatting of dates. There are 2 implementations available, the `CalendarNativeDateFormatter` (default) 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>. * * If you wish, you may override any of the defaults via angulars DI. For example: * * ``` * import { CalendarDateFormatter, DateFormatterParams } from 'angular-calendar'; * * class CustomDateFormatter extends CalendarDateFormatter { * * public monthViewColumnHeader({date, locale}: DateFormatterParams): string { * return new Intl.DateTimeFormat(locale, {weekday: 'short'}).format(date); // use short week days * } * * } * * // in your component that uses the calendar * providers: [{ * provide: CalendarDateFormatter, * useClass: CustomDateFormatter * }] * ``` */ export declare class CalendarDateFormatter extends CalendarNativeDateFormatter { }