import {Injectable} from '@angular/core';

@Injectable()
export class UtilService {
  constructor() {}

  public getStartDate(start): any {
    const tmpStart = new Date(start);
    const year = tmpStart.getFullYear();
    const month = tmpStart.getMonth();
    const day = tmpStart.getDate();
    return new Date(year, month, day, 0, 0, 0 ).valueOf();
  }

  public getEndDate(end) {
    const tmpEnd = new Date(end);
    const year = tmpEnd.getFullYear();
    const month = tmpEnd.getMonth();
    const day = tmpEnd.getDate();
    return new Date(year, month, day, 23, 59, 59 ).valueOf();
  }
}
