Skip to content

Commit

Permalink
Use constance to show the correct quarter
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelglenister committed Jun 3, 2024
1 parent 9b95ecb commit bd952fd
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions assets/js/components/income.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,13 +341,9 @@ export class NationalConditionalGrantsSection extends AbstractIncomeSection {
this._transferredLabel = {};
this._spentLabel = {};
for (const year in this._chartData) {
const legendYear = this.sectionData.snapshot_date.year;
let legendQuarter = null;
if (year >= this.sectionData.snapshot_date.year) {
legendQuarter = this.sectionData.snapshot_date.quarter;
} else if (year < this.sectionData.snapshot_date.year) {
legendQuarter = 4;
}
let legendYear = this.sectionData.snapshot_date.year;
let legendQuarter = this.sectionData.snapshot_date.quarter;

this._transferredLabel[year] = `Amount transferred up to ${legendYear} Q${legendQuarter}`;
this._spentLabel[year] = `Amount spent up to ${legendYear} Q${legendQuarter}`;

Expand Down

0 comments on commit bd952fd

Please sign in to comment.