File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
packages/cubejs-schema-compiler/src/adapter Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ export class Granularity {
4444 this . granularityInterval = customGranularity . interval ;
4545
4646 if ( customGranularity . origin ) {
47- this . origin = moment ( new Date ( customGranularity . origin ) ) ;
47+ this . origin = moment . tz ( customGranularity . origin , 'UTC' ) ;
4848 } else if ( customGranularity . offset ) {
4949 this . granularityOffset = customGranularity . offset ;
5050 this . origin = addInterval ( this . origin , parseSqlInterval ( customGranularity . offset ) ) ;
@@ -61,6 +61,13 @@ export class Granularity {
6161 return this . granularity ;
6262 }
6363
64+ if ( this . origin ) {
65+ return this . query . minGranularity (
66+ this . granularityFromInterval ( ) ,
67+ this . query . granularityFor ( this . origin . utc ( ) )
68+ ) ;
69+ }
70+
6471 if ( this . granularityOffset ) {
6572 return this . query . minGranularity (
6673 this . granularityFromInterval ( ) ,
You can’t perform that action at this time.
0 commit comments