import { formatDate } from '@angular/common';
import { Component, OnInit, ChangeDetectionStrategy, Output, EventEmitter, Input } from '@angular/core';
import { createQueryStringFromObject } from 'src/app/shared/util/func';

@Component({
  selector: 'daily-summary-search',
  templateUrl: './daily-summary-search.component.html',
  styleUrls: ['./daily-summary-search.component.scss'],
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class DailySummarySearchComponent 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)
  }

}
