Pull request #281: TV-811 Because it's workdays and not calendar days we temporarily set this to much more.

Merge in TEA/mina-sidor-fa-web from feature/TV-811-increase-dates-since-its-workdays-and-not-calendar-days to next

Squashed commit of the following:

commit cdafaee42c71d8d4e0bf0d87ffc6e542a02e9e82
Author: Daniel Appelgren <daniel.appelgren@arbetsformedlingen.se>
Date:   Fri Nov 26 10:11:14 2021 +0100

    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
This commit is contained in:
Daniel Appelgren
2021-11-26 10:24:48 +01:00
parent b471feb119
commit 8636049866
3 changed files with 9 additions and 3 deletions

View File

@@ -139,7 +139,9 @@ export class AvvikelseReportFormComponent implements OnInit, OnDestroy {
return new Date() > startDate;
}
private _isBeforeLastPossibleReportDay(endDate: Date): boolean {
const lastPossibleReportDay = addDays(endDate, 5); // Reporting is allowed at latest 5 days past avrop end date.
// Reporting is allowed at latest 5 days past avrop end date.
// 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);
return lastPossibleReportDay > new Date();
}

View File

@@ -154,7 +154,9 @@ export class GemensamPlaneringFormComponent {
return new Date() > startDate;
}
private _isBeforeLastPossibleReportDay(endDate: Date): boolean {
const lastPossibleReportDay = addDays(endDate, 5); // Reporting is allowed at latest 5 days past avrop end date.
// Reporting is allowed at latest 5 days past avrop end date.
// 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);
return lastPossibleReportDay > new Date();
}

View File

@@ -64,7 +64,9 @@ export class SlutredovisningFormComponent {
}
private _isBeforeLastPossibleReportDay(date: Date): boolean {
const lastPossibleReportDay = addDays(date, 60); // Reporting is allowed at latest 60 days past avrop end date.
// Reporting is allowed at latest 60 days past avrop end date.
// 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);
return lastPossibleReportDay > new Date();
}