Skip to content

Commit c74839a

Browse files
committed
Adjust the histogram hour labels for local tz
1 parent 2fb51e8 commit c74839a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Histogram.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ class Histogram extends Component{
1818

1919
formatHistogram(histogram) {
2020
return Object.keys(histogram).sort().map(x => {
21+
let now = new Date();
22+
let offset = now.getTimezoneOffset();
2123
return {
22-
'name': x,
24+
'name': ((parseInt(x) - offset/60 + 24) % 24).toString(),
2325
'count': histogram[x]
2426
}
2527
})
@@ -37,7 +39,7 @@ class Histogram extends Component{
3739
<YAxis />
3840
<Tooltip />
3941
<Legend />
40-
<Bar dataKey="count" name="All FEC over limit events in this hour" fill="#8884d8" />
42+
<Bar dataKey="count" name="Hourly FEC over limit histogram" fill="#8884d8" />
4143
</BarChart>
4244
</ResponsiveContainer>
4345
</div>)

0 commit comments

Comments
 (0)