Skip to content

Commit

Permalink
Fix hardcoded fire year (#668)
Browse files Browse the repository at this point in the history
This makes me upset. Never hard-code these kinds of magic numbers, especially something that changes each year.
  • Loading branch information
dhlevi authored Apr 3, 2023
1 parent 23ad0e0 commit baf87d3
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit baf87d3

Please sign in to comment.