angular-calendar
Version:
A calendar component that can display events on a month, week or day view
31 lines • 1.21 kB
JavaScript
import { Pipe, LOCALE_ID, Inject } from '@angular/core';
import { CalendarDateFormatter } from './../providers/calendarDateFormatter.provider';
/**
* This pipe is primarily for rendering the current view title. Example usage:
* ```
* // where `viewDate` is a `Date` and view is `'month' | 'week' | 'day'`
* {{ viewDate | calendarDate:(view + 'ViewTitle'):'en' }}
* ```
*/
export var CalendarDatePipe = (function () {
function CalendarDatePipe(dateFormatter, locale) {
this.dateFormatter = dateFormatter;
this.locale = locale;
}
CalendarDatePipe.prototype.transform = function (date, method, locale) {
if (locale === void 0) { locale = this.locale; }
return this.dateFormatter[method]({ date: date, locale: locale });
};
CalendarDatePipe.decorators = [
{ type: Pipe, args: [{
name: 'calendarDate'
},] },
];
/** @nocollapse */
CalendarDatePipe.ctorParameters = function () { return [
{ type: CalendarDateFormatter, },
{ type: undefined, decorators: [{ type: Inject, args: [LOCALE_ID,] },] },
]; };
return CalendarDatePipe;
}());
//# sourceMappingURL=calendarDate.pipe.js.map