import { Component, ChangeDetectionStrategy, Host } from '@angular/core';
import { DateAdapter } from '@ui/common';
import { UiCalendarComponent } from '../ui-calendar.component';

@Component({
  selector: 'ui-calendar-header',
  templateUrl: 'calendar-header.component.html',
  styleUrls: ['calendar-header.component.scss'],
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class UiCalendarHeaderComponent {
  constructor(@Host() public calendar: UiCalendarComponent) {}

  prev() {
    this.calendar.navigateBack();
  }

  next() {
    this.calendar.navigateForth();
  }

  today() {
    this.calendar.setDisplayed(this.calendar.today);
    this.calendar.setSelected(this.calendar.today);
  }
}
