2021-01-25 16:19:50 +01:00
|
|
|
import { CalendarDateFormatter, DateFormatterParams } from 'angular-calendar';
|
|
|
|
|
import { formatDate } from '@angular/common';
|
|
|
|
|
import { Injectable } from '@angular/core';
|
|
|
|
|
|
|
|
|
|
@Injectable()
|
|
|
|
|
export class CustomDateFormatter extends CalendarDateFormatter {
|
|
|
|
|
// you can override any of the methods defined in the parent class
|
|
|
|
|
|
|
|
|
|
public dayViewHour({ date, locale }: DateFormatterParams): string {
|
2021-01-26 10:53:12 +01:00
|
|
|
return formatDate(date, 'HH', locale);
|
2021-01-25 16:19:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public weekViewHour({ date, locale }: DateFormatterParams): string {
|
|
|
|
|
return this.dayViewHour({ date, locale });
|
|
|
|
|
}
|
|
|
|
|
}
|