carto-vl icon indicating copy to clipboard operation
carto-vl copied to clipboard

Date properties and expressions

Open davidmanzanares opened this issue 6 years ago • 3 comments

To improve precision, all date properties are re-mapped to the [0,1] range. This makes all arithmetic operations to be unimplemented (I don't know right now if at least we are throwing a type-check error if the user tries).

The only way right now to work around this issue is to use linear() since it has the re-mapping logic. For example, to check that a date property is within today you'll need a hack like:

between(linear($date, firstSecondOfToday, lastSecondOfToday), 0.01, 0.99)

davidmanzanares avatar Jun 07 '18 09:06 davidmanzanares

I think that we could start by implementing between for dates and implement more expressions if users request those features.

davidmanzanares avatar Jun 15 '18 10:06 davidmanzanares

I had seconds thoughts about this now, implementing it partially could confuse users, implementing it completely is a major change and will require much time.

davidmanzanares avatar Jun 26 '18 13:06 davidmanzanares

Let's review this issue in the context of https://github.com/CartoDB/carto-vl/issues/551.

rochoa avatar Aug 24 '18 12:08 rochoa