import {Injectable} from '@angular/core'; const WEEKDAYS_SHORT = ['Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su']; const MONTHS_SHORT = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; const MONTHS_FULL = [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ]; /** * Type of the service supplying month and weekday names to to Ng2vDatepicker component. * See the i18n demo for how to extend this class and define a custom provider for i18n. */ @Injectable() export abstract class Ng2vDatepickerI18n { /** * Returns the short weekday name to display in the heading of the month view. * With default calendar we use ISO 8601: 'weekday' is 1=Mon ... 7=Sun */ abstract getWeekdayShortName(weekday: number): string; /** * Returns the short month name to display in the date picker navigation. * With default calendar we use ISO 8601: 'month' is 1=Jan ... 12=Dec */ abstract getMonthShortName(month: number): string; /** * Returns the full month name to display in the date picker navigation. * With default calendar we use ISO 8601: 'month' is 1=January ... 12=December */ abstract getMonthFullName(month: number): string; } @Injectable() export class Ng2vDatepickerI18nDefault extends Ng2vDatepickerI18n { getWeekdayShortName(weekday: number): string { return WEEKDAYS_SHORT[weekday - 1]; } getMonthShortName(month: number): string { return MONTHS_SHORT[month - 1]; } getMonthFullName(month: number): string { return MONTHS_FULL[month - 1]; } }