AW-3477 fmHasPackage check werkt niet correct voor vandaag
This commit is contained in:
parent
74c77bae5e
commit
b752b377da
@ -51,7 +51,9 @@ export function getValidPackages(packageMap: IPackages): {[key: string]: IPackag
|
||||
}
|
||||
|
||||
export function isValidPackage(pack: IPackage): boolean {
|
||||
const today = new Date(new Date(Date.now()).toUTCString()).setHours(0, 0, 0, 0);
|
||||
return pack !== null && new Date(pack.dataDate).getTime() <= today
|
||||
&& (!pack.dataEndDate || new Date(pack.dataEndDate).getTime() >= today);
|
||||
const now = new Date(Date.now());
|
||||
const utcToday = Date.UTC(now.getUTCFullYear(),now.getUTCMonth(),now.getUTCDate());
|
||||
return pack !== null && new Date(pack.dataDate).getTime() <= utcToday
|
||||
&& (!pack.dataEndDate || new Date(pack.dataEndDate).getTime() >= utcToday);
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user