Commit ab2f9ef4cd1ffeff339f89bd9477f6528960e481

Authored by Marcelo Puebla
1 parent 5cb7d57f83
Exists in develop

Fix

Metodo para validar vigencia
Showing 1 changed file with 4 additions and 3 deletions   Show diff stats
src/app/utils/dateExtension.ts
1 export class DateExtension { 1 export class DateExtension {
2 2
3 public static ValidateDateRange(dateStart: string, dateEnd: string) { 3 public static ValidateDateRange(dateStart: string, dateEnd: string) {
4 if (dateEnd === null) return false; 4 if (dateEnd === null) return false;
5 const today = new Date(Date.now()); 5 const today = Date.now();
6 return (new Date(dateStart) <= today && today <= new Date(dateEnd)) 6 const timeStart = new Date(dateStart).getTime();
7 ? true : false; 7 const timeEnd = new Date(dateEnd).getTime();
8 return (timeStart <= today && today <= timeEnd) ? false : true;
8 } 9 }
9 10
10 } 11 }
11 12