turnilo icon indicating copy to clipboard operation
turnilo copied to clipboard

Time granularities like PT18H or P2D return not floorable

Open akansal1 opened this issue 6 years ago • 5 comments

Hi,

We are trying to achieve time granularities like PT18H and P2D but time split return not floorable, is there a reason to keep this limitation or this is a bug ?

thanks

akansal1 avatar Jan 07 '19 19:01 akansal1

It looks like a bug, we will investigate the issue soon. Thanks!

mkuthan avatar Jan 09 '19 17:01 mkuthan

https://github.com/implydata/plywood/blob/master/src/expressions/timeBucketExpression.ts#L47

Plywood requires Duration to be floor able to create TimeBucket. I don't think we can bypass that.

adrianmroz avatar Jan 10 '19 09:01 adrianmroz

Plywood uses chronoshift to this calculation https://github.com/implydata/chronoshift/blob/master/src/duration/duration.ts#L256

Which is using criteria defined in https://github.com/implydata/chronoshift/blob/master/src/floor-shift-ceil/floor-shift-ceil.ts

So, in principle making changes in chronoshift logic should work and you will not require to bypass anything in Plywood

akansal1 avatar Jan 10 '19 18:01 akansal1

This library is also not in our control. Maybe we should create ticket in plywood repo? Chronoshift is also supported by them.

adrianmroz avatar Jan 10 '19 20:01 adrianmroz

Let's see what happens: https://github.com/implydata/plywood/issues/180

adrianmroz avatar Jan 15 '19 10:01 adrianmroz