@rifansi/angular-datetime-picker
Version:
Angular Date Time Picker
30 lines (26 loc) • 1.16 kB
text/typescript
import { ChangeDetectionStrategy, Component, Inject, Input, Optional } from '@angular/core';
import { OwlDateTimeIntl } from './date-time-picker-intl.service';
import { DateTimeAdapter } from './adapter/date-time-adapter.class';
import { OWL_DATE_TIME_FORMATS, OwlDateTimeFormats } from './adapter/date-time-format.class';
import { CalendarAgenda } from './calendar-agenda.class';
({
selector: 'owl-date-time-agenda-list',
templateUrl: './agenda-list.component.html',
styleUrls: ['./agenda-list.component.scss'],
standalone: false,
preserveWhitespaces: false,
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class OwlAgendaListComponent<T> {
()
agendas: CalendarAgenda[] = [];
constructor(
protected pickerIntl: OwlDateTimeIntl,
() protected dateTimeAdapter: DateTimeAdapter<T>,
() (OWL_DATE_TIME_FORMATS) protected dateTimeFormats: OwlDateTimeFormats
) {}
formatTime(time: Date): string {
const d = this.dateTimeAdapter.deserialize(time);
return this.dateTimeAdapter.format(d, this.dateTimeFormats.timePickerInput);
}
}