import { Pipe, PipeTransform } from '@angular/core';

@Pipe({
  name: 'daysToPeriod'
})
export class DaysToPeriodPipe implements PipeTransform {

  transform(value:number): string {
    if(value == null) return "uso único";
    else if(value == 15) return "quinzenal";
    else if(value == 30) return "mensual";
    else if(value == 60) return "bimensual";
    else if(value == 90) return "trimestral";
    else if(value == 120) return "quatrimestral";
    else if(value == 180) return "semestral";
    else if(value == 365) return "anual";
    else return `cada ${value} días`;
  }

}
