Skip to content

Commit

Permalink
Merge pull request #2073 from bcgov/feature/ALCS-1871-4
Browse files Browse the repository at this point in the history
QA Fixes #2: 1871
  • Loading branch information
Abradat authored Jan 22, 2025
2 parents da77acd + c7a735c commit 5bfc745
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ <h3 class="card-title">
</ng-template>
</ng-container>
<ng-template #multipleDateColumn>
<span class="date-label">Due Date:</span>
<span class="date-label">Due Date: </span>
</ng-template>
<ng-container *ngIf="getDate(element.condition); else noDate">
{{ getDate(element.condition) }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,18 +155,26 @@ export class ApplicationDecisionConditionDialogComponent extends CardDialogCompo
if (condition.dates && condition.dates.length > 0) {
let minDueDate: ApplicationDecisionConditionDateDto | null = null;
let maxDueDate: ApplicationDecisionConditionDateDto | null = null;
let allDatesNull = true;

for (const date of condition.dates) {
if (!maxDueDate || date.date! > maxDueDate.date!) {
maxDueDate = date;
}
if (!date.completedDate) {
if (!minDueDate || date.date! < minDueDate.date!) {
minDueDate = date;
if (date.date !== null) {
allDatesNull = false;
if (!maxDueDate || date.date! > maxDueDate.date!) {
maxDueDate = date;
}
if (!date.completedDate) {
if (!minDueDate || date.date! < minDueDate.date!) {
minDueDate = date;
}
}
}
}

if (allDatesNull) {
return null;
}

const selectedDate = minDueDate || maxDueDate;
return selectedDate ? this.formatTimestamp(selectedDate.date!) : null;
}
Expand Down

0 comments on commit 5bfc745

Please sign in to comment.