From 33f322424e0b512591228d4d252f3e67ec0bb5a3 Mon Sep 17 00:00:00 2001 From: Mark van der Wal Date: Thu, 27 Jan 2022 17:25:12 +0100 Subject: [PATCH] AW-3441 fix oopsie --- package.json | 2 +- projects/common/src/fm/services/package.service.ts | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 7681903..b1eb116 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "farmmaps-lib-app", - "version": "1.1.8", + "version": "1.1.9", "scripts": { "ng": "ng", "start": "ng serve", diff --git a/projects/common/src/fm/services/package.service.ts b/projects/common/src/fm/services/package.service.ts index cf2a427..7afd1c9 100644 --- a/projects/common/src/fm/services/package.service.ts +++ b/projects/common/src/fm/services/package.service.ts @@ -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 { @@ -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); }