Skip to content

Commit 3cfc64d

Browse files
Merge pull request #535 from datacite/usage-time-zone-issue
Set usage dates to the middle of the month to avoid time zone drift
2 parents 23a3da0 + 0c4c3bd commit 3cfc64d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/components/UsageChart/UsageChart.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ const UsageChart: React.FunctionComponent<Props> = ({
7474
return isAfter(chartDate, publicationYear || 0)
7575
})
7676

77+
const subsetWithTimezone = subset.map((d) => ({
78+
...d,
79+
yearMonth: d.yearMonth + '-15T00:00:00Z'
80+
}))
81+
7782
// get domain, set width according to screen size
7883
/* istanbul ignore next */
7984
const domain = Math.abs(differenceInMonths(lowerBound, new Date()))
@@ -163,7 +168,7 @@ const UsageChart: React.FunctionComponent<Props> = ({
163168
<VegaLite
164169
renderer="svg"
165170
spec={spec}
166-
data={{ table: subset }}
171+
data={{ table: subsetWithTimezone }}
167172
actions={actions}
168173
/>
169174
</Row>

0 commit comments

Comments
 (0)