import {Component, OnInit, ChangeDetectionStrategy, Output, EventEmitter, Input} from '@angular/core';
import {formatDate} from '@angular/common';

@Component({
  selector: 'app-daily-summary-ttb-search',
  templateUrl: './daily-summary-ttb-search.component.html',
  styleUrls: ['./daily-summary-ttb-search.component.scss'],
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class DailySummaryTtbSearchComponent implements OnInit {
  @Output() search = new EventEmitter()
  @Input() testingInfo: any = [];
  query = {
    payment_date: null
  }
  constructor() { }

  ngOnInit(): void {
  }

  onSearch(){
    if(this.query.payment_date)this.query.payment_date = formatDate(this.query.payment_date, 'yyyy-MM-dd', 'en-US')
    this.search.emit(this.query.payment_date)
  }

}
