From 76a12f7b8f5d755137958ca8348a14348f30db63 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Mon, 25 Jan 2021 16:19:50 +0100 Subject: [PATCH] Add calendar timeline --- .../agenda/custom-date-formatter.provider.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/app/pages/agenda/custom-date-formatter.provider.ts diff --git a/src/app/pages/agenda/custom-date-formatter.provider.ts b/src/app/pages/agenda/custom-date-formatter.provider.ts new file mode 100644 index 000000000..03c5eda79 --- /dev/null +++ b/src/app/pages/agenda/custom-date-formatter.provider.ts @@ -0,0 +1,16 @@ +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 { + return formatDate(date, 'HH:mm', locale); + } + + public weekViewHour({ date, locale }: DateFormatterParams): string { + return this.dayViewHour({ date, locale }); + } +}