AW-3441 fix oopsie
All checks were successful
FarmMaps/FarmMapsLib/pipeline/head This commit looks good

This commit is contained in:
Mark van der Wal 2022-01-27 17:25:12 +01:00
parent 519b81d1fd
commit 33f322424e
2 changed files with 4 additions and 8 deletions

View File

@ -1,6 +1,6 @@
{
"name": "farmmaps-lib-app",
"version": "1.1.8",
"version": "1.1.9",
"scripts": {
"ng": "ng",
"start": "ng serve",

View File

@ -27,11 +27,7 @@ export class PackageService {
}
hasPackage(id: string): boolean {
if (!this.packages[id]) {
return false;
}
return this.packages[id].enabled;
return id in this.packages;
}
postItemPackageTask(item: IItem, task: IItemTask): Observable<IItemTask> {
@ -41,6 +37,6 @@ export class PackageService {
export function isValidPackage(pack: IPackage): boolean {
const today = new Date(new Date(Date.now()).toUTCString()).setHours(0, 0, 0, 0);
return pack !== null && pack.dataDate.getTime() <= today
&& (!pack.dataEndDate || pack.dataEndDate.getTime() >= today);
return pack !== null && new Date(pack.dataDate).getTime() <= today
&& (!pack.dataEndDate || new Date(pack.dataEndDate).getTime() >= today);
}