Skip to content

Commit

Permalink
Fix order of dates in tooltips for series graph
Browse files Browse the repository at this point in the history
  • Loading branch information
jorg-vr committed Apr 29, 2024
1 parent bfd92a9 commit 0ce737e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/assets/javascripts/visualisations/timeseries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,14 +266,14 @@ export class TimeseriesGraph extends SeriesExerciseGraph {
} else if (this.binStep < 168) { // binning per multiple days
const format = d3.timeFormat(i18n.t("date.formats.weekday_long"));
message = `
<b>${format(new Date(d.date - this.binStep * 3600000))} - ${format(d.date)}:</b>
<b>${format(d.date)} - ${format(new Date(d.date + this.binStep * 3600000))}:</b>
<br>
`;
} else { // binning per week(s)
const weekDay = d3.timeFormat(i18n.t("date.formats.weekday_long"));
const monthDay = d3.timeFormat(i18n.t("date.formats.monthday_long"));
message = `
<b>${weekDay(new Date(d.date - this.binStep * 3600000))} - ${monthDay(d.date)}:</b>
<b>${weekDay(d.date)} - ${monthDay(new Date(d.date + this.binStep * 3600000))}:</b>
<br>
`;
}
Expand Down

0 comments on commit 0ce737e

Please sign in to comment.