Skip to content

Commit 9be0355

Browse files
committed
fix: update getDatesSeparatedByYear function
- include the `endDate` if it matches the exact start of a year
1 parent 14fce9c commit 9be0355

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

app/src/views/OperationalLearning/Stats/OperationalLearningMap/i18n.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"namespace": "operationalLearning",
33
"strings": {
44
"downloadMapTitle": "Operational learning map",
5-
"legendLabel": "Learning count",
6-
"learningCountLegendLabel":"Learning count"
5+
"learningCount": "Learning count"
76
}
87
}

app/src/views/OperationalLearning/Stats/OperationalLearningMap/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ function OperationalLearningMap(props: Props) {
206206
footerClassName={styles.footer}
207207
footerContent={(
208208
<div className={styles.legend}>
209-
<div className={styles.legendLabel}>{strings.legendLabel}</div>
209+
<div className={styles.legendLabel}>{strings.learningCount}</div>
210210
<div className={styles.legendContent}>
211211
<div
212212
className={styles.gradient}
@@ -267,7 +267,7 @@ function OperationalLearningMap(props: Props) {
267267
>
268268
<TextOutput
269269
value={clickedPointProperties.feature.properties.learningCount}
270-
label={strings.learningCountLegendLabel}
270+
label={strings.learningCount}
271271
valueType="number"
272272
/>
273273
</Container>

packages/ui/src/utils/chart.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ export function getDatesSeparatedByYear(startDate: Date, endDate: Date) {
154154

155155
const dates = [];
156156

157-
while (currentDate.getTime() < targetDate.getTime()) {
157+
while (currentDate.getTime() <= targetDate.getTime()) {
158158
dates.push(new Date(currentDate));
159159
currentDate.setFullYear(currentDate.getFullYear() + 1);
160160
currentDate.setHours(0, 0, 0, 0);

0 commit comments

Comments
 (0)