Skip to content

Commit f87ab2b

Browse files
authored
Merge pull request #95 from back4app/fix-analytics-timezone
Use UTC date as reference in analytics chart
2 parents e2f44b3 + beec33f commit f87ab2b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/Chart/Chart.react.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function sortPoints(a, b) {
2525
}
2626

2727
function formatDate(date) {
28-
let str = DateUtils.getMonth(date.getMonth()) + ' ' + date.getDate();
28+
let str = DateUtils.getMonth(date.getUTCMonth()) + ' ' + date.getUTCDate();
2929
if (date.getUTCHours() === 0 && date.getUTCMinutes() === 0 && date.getUTCSeconds() === 0) {
3030
return str;
3131
}
@@ -182,7 +182,7 @@ Chart.propTypes = {
182182
'The height of the chart.'
183183
),
184184
data: PropTypes.object.isRequired.describe(
185-
'The data to graph. It is a map of data names to objects containing two keys: ' +
185+
'The data to graph. It is a map of data names to objects containing two keys: ' +
186186
'"color," the color to use for the lines, and "points," an array of tuples containing time-value data.'
187187
),
188188
formatter: PropTypes.func.describe(

0 commit comments

Comments
 (0)