Skip to content

Commit

Permalink
Merge pull request #5510 from dodona-edu/fix/date-order
Browse files Browse the repository at this point in the history
Fix dates in tooltips for series graph
  • Loading branch information
jorg-vr authored Apr 29, 2024
2 parents bfd7e23 + 0ce737e commit 8371d53
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(d.date)} - ${format(new Date(d.date - this.binStep * 3600000))}:</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(d.date)} - ${monthDay(new Date(d.date - this.binStep * 3600000))}:</b>
<b>${weekDay(d.date)} - ${monthDay(new Date(d.date + this.binStep * 3600000))}:</b>
<br>
`;
}
Expand Down

0 comments on commit 8371d53

Please sign in to comment.