Skip to content

Commit

Permalink
Merge pull request #329 from kinvolk/fix-format-for-7days-period
Browse files Browse the repository at this point in the history
Fix date format for 7 days period in Timeline Chart
  • Loading branch information
joaquimrocha authored Feb 12, 2021
2 parents 7dac3d4 + ba832ae commit 27b3a4c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions frontend/src/js/components/Groups/Charts.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function TimelineChart(props) {

if (lengthMinutes === 7 * DAY) {
tickCount = 7;
dateFormat = {useDate: true, showTime: false};
dateFormat = {dateFormat: {month: 'short', day: 'numeric'}, showTime: false};
}
if (lengthMinutes === 60) {
for (let i = 0; i < 4; i++) {
Expand Down Expand Up @@ -80,8 +80,7 @@ function TimelineChart(props) {
}
}
// The midnight tick just gets the date, not the hours (since they're zero)
ticks[midnightTick] = makeLocaleTime(midnightDay, {showTime: false});

ticks[midnightTick] = makeLocaleTime(midnightDay, {dateFormat: {month: 'short', day: 'numeric'}, showTime: false});
return ticks;
}

Expand Down

0 comments on commit 27b3a4c

Please sign in to comment.