open-innovations / oi-lume-viz

Lume Plugin that enables charting
https://open-innovations.github.io/oi-lume-viz/
5 stars 1 forks source link

Virtual column filter to convert date formats #52

Closed luke-strange closed 1 month ago

luke-strange commented 1 month ago

Convert between ISO861, Unix timestamp, US date format, and decimal dates.

This should be available as a filter to create a virtual column.

slowe commented 1 month ago

We now have strptime for converting (some) text-based times into date objects. So it can deal with parsing US/UK date formats. I've also added decimalYear as a filter so that we can convert a date into a decimal year. These can be chained e.g. {{ value | strptime("%b %Y") | decimalYear() }} to convert a particular column from Jul 2024 to 2024.49727.