From baf87d388935c4f5e546cd97b270664663b3fd95 Mon Sep 17 00:00:00 2001 From: Dylan Date: Mon, 3 Apr 2023 08:46:07 -0700 Subject: [PATCH] Fix hardcoded fire year (#668) This makes me upset. Never hard-code these kinds of magic numbers, especially something that changes each year. --- .../angular/src/app/store/incidents/incidents.effects.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/client/wfnews-war/src/main/angular/src/app/store/incidents/incidents.effects.ts b/client/wfnews-war/src/main/angular/src/app/store/incidents/incidents.effects.ts index 6a025d983d..19606abae3 100644 --- a/client/wfnews-war/src/main/angular/src/app/store/incidents/incidents.effects.ts +++ b/client/wfnews-war/src/main/angular/src/app/store/incidents/incidents.effects.ts @@ -67,10 +67,16 @@ export class IncidentsEffect { let fireCentreFilter = typedaction.payload.filters["selectedFireCentreCode"] ? typedaction.payload.filters["selectedFireCentreCode"] : savedFireCentreFilter; let fireOfNotePublishedInd = typedaction.payload.filters["selectedFireOfNotePublishedInd"] ? typedaction.payload.filters["selectedFireOfNotePublishedInd"] : savedFireOfNotePublishedIndFilter; + const now = new Date() + let currentFireYear = now.getFullYear() + if (now.getMonth() < 3) { + currentFireYear -= 1 + } + return this.incidentListService.getWildfireIncidentList( undefined, searchText, - [`2022`], + [`${currentFireYear}`], undefined, undefined, undefined,