Commit ab2f9ef4cd1ffeff339f89bd9477f6528960e481
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
| ... | ... | @@ -2,9 +2,10 @@ export class DateExtension { |
| 2 | 2 | |
| 3 | 3 | public static ValidateDateRange(dateStart: string, dateEnd: string) { |
| 4 | 4 | if (dateEnd === null) return false; |
| 5 | - const today = new Date(Date.now()); | |
| 6 | - return (new Date(dateStart) <= today && today <= new Date(dateEnd)) | |
| 7 | - ? true : false; | |
| 5 | + const today = Date.now(); | |
| 6 | + const timeStart = new Date(dateStart).getTime(); | |
| 7 | + const timeEnd = new Date(dateEnd).getTime(); | |
| 8 | + return (timeStart <= today && today <= timeEnd) ? false : true; | |
| 8 | 9 | } |
| 9 | 10 | |
| 10 | 11 | } |