Skip to content

Commit 8fd7876

Browse files
committed
fix: minute requests incorrectly snapped to daily partitions
1 parent d1b9b44 commit 8fd7876

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/cubejs-schema-compiler/adapter/BaseTimeDimension.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const UserError = require('../compiler/UserError');
66

77
const TIME_SERIES = {
88
day: (range) =>
9-
Array.from(range.by('day'))
9+
Array.from(range.snapTo('day').by('day'))
1010
.map(d => [d.format('YYYY-MM-DDT00:00:00.000'), d.format('YYYY-MM-DDT23:59:59.999')]),
1111
month: (range) =>
1212
Array.from(range.snapTo('month').by('month'))
@@ -15,13 +15,13 @@ const TIME_SERIES = {
1515
Array.from(range.snapTo('year').by('year'))
1616
.map(d => [d.format('YYYY-01-01T00:00:00.000'), d.endOf('year').format('YYYY-MM-DDT23:59:59.999')]),
1717
hour: (range) =>
18-
Array.from(range.by('hour'))
18+
Array.from(range.snapTo('hour').by('hour'))
1919
.map(d => [d.format('YYYY-MM-DDTHH:00:00.000'), d.format('YYYY-MM-DDTHH:59:59.999')]),
2020
minute: (range) =>
21-
Array.from(range.by('minute'))
21+
Array.from(range.snapTo('minute').by('minute'))
2222
.map(d => [d.format('YYYY-MM-DDTHH:MM:00.000'), d.format('YYYY-MM-DDTHH:MM:59.999')]),
2323
second: (range) =>
24-
Array.from(range.by('second'))
24+
Array.from(range.snapTo('second').by('second'))
2525
.map(d => [d.format('YYYY-MM-DDTHH:MM:SS.000'), d.format('YYYY-MM-DDTHH:MM:SS.999')]),
2626
week: (range) =>
2727
Array.from(range.snapTo('isoweek').by('week'))

0 commit comments

Comments
 (0)