cube
cube copied to clipboard
Format time dimensions
Is your feature request related to a problem? Please describe. Cube could provide a date formatter, since we can throw the responsability of this to the database. I don't think cube should allow format any fields, because this will cause some performance issues and the api it's pretty fast, but since dates could be easily formated in the query maybe we can create somethig.
Describe the solution you'd like Add another property to time dimensions, including the property format, whatever this field it's used as dimensions we can check the property format from that particular time dimension. Maybe let this options be added to dimension it self, but just work for date times.
"timeDimensions": [
{
"dateRange": "Last 30 days",
"dimension": "Route.route_date",
"format": "Y-m-d"
}
]
or
"measures": [
"Route.countRescuer",
{measure: "Route.route_date",format:"Y-m-d"}
],
Additional context Slack link discussion https://cube-js.slack.com/archives/CC0403RRR/p1622747379065300
Same here