From 33149f2fcb92f6faa4f2008e859339d25b05b23a Mon Sep 17 00:00:00 2001 From: Daniel Appelgren Date: Tue, 25 Jan 2022 12:20:59 +0100 Subject: [PATCH] =?UTF-8?q?fix(Gemensam=20planering):=20=C3=84ndrat=20datu?= =?UTF-8?q?m=20d=C3=A5=20det=20till=C3=A5ts=20att=20skicka=20in=20gemensam?= =?UTF-8?q?=20planering=20och=20slutredovisning=20fr=C3=A5n=2015=20resp=20?= =?UTF-8?q?100=20till=2084=20(dvs=2060*7/5)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gemensam-planering-form.component.ts | 4 ++-- .../slutredovisning-form/slutredovisning-form.component.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/mina-sidor-fa/src/app/pages/deltagare/pages/deltagare-details/pages/report-forms/gemensam-planering-form/gemensam-planering-form.component.ts b/apps/mina-sidor-fa/src/app/pages/deltagare/pages/deltagare-details/pages/report-forms/gemensam-planering-form/gemensam-planering-form.component.ts index a426c63..900eaa8 100644 --- a/apps/mina-sidor-fa/src/app/pages/deltagare/pages/deltagare-details/pages/report-forms/gemensam-planering-form/gemensam-planering-form.component.ts +++ b/apps/mina-sidor-fa/src/app/pages/deltagare/pages/deltagare-details/pages/report-forms/gemensam-planering-form/gemensam-planering-form.component.ts @@ -154,9 +154,9 @@ export class GemensamPlaneringFormComponent { return new Date() > startDate; } private _isBeforeLastPossibleReportDay(endDate: Date): boolean { - // Reporting is allowed at latest 5 days past avrop end date. + // Reporting is allowed at latest 60 working days past avrop end date. To calculate calendar days we remove weekends like this 60*7/5=84 // Because it's workdays and not calendar days we temporarily set this to much more. This date should be fetched from API in the future - const lastPossibleReportDay = addDays(endDate, 15); + const lastPossibleReportDay = addDays(endDate, 84); return lastPossibleReportDay > new Date(); } diff --git a/apps/mina-sidor-fa/src/app/pages/deltagare/pages/deltagare-details/pages/report-forms/slutredovisning-form/slutredovisning-form.component.ts b/apps/mina-sidor-fa/src/app/pages/deltagare/pages/deltagare-details/pages/report-forms/slutredovisning-form/slutredovisning-form.component.ts index 2489eb3..31174bb 100644 --- a/apps/mina-sidor-fa/src/app/pages/deltagare/pages/deltagare-details/pages/report-forms/slutredovisning-form/slutredovisning-form.component.ts +++ b/apps/mina-sidor-fa/src/app/pages/deltagare/pages/deltagare-details/pages/report-forms/slutredovisning-form/slutredovisning-form.component.ts @@ -64,9 +64,9 @@ export class SlutredovisningFormComponent { } private _isBeforeLastPossibleReportDay(date: Date): boolean { - // Reporting is allowed at latest 60 days past avrop end date. + // Reporting is allowed at latest 60 working days past avrop end date. To calculate calendar days we remove weekends like this 60*7/5=84 // Because it's workdays and not calendar days we temporarily set this to much more. This date should be fetched from API in the future - const lastPossibleReportDay = addDays(date, 100); + const lastPossibleReportDay = addDays(date, 84); return lastPossibleReportDay > new Date(); }