We are using the flexmonster data server and put together different indexes with sql queries. That works all good, but I wanted to understand how I could use a date field with the data server. I format the date fields like this
But it seems like the date field is not recognized as a date field. Can you let me know how I need to format the date fields?
Furthermore, when the date fields are recognized as date fields, how can I use a hierarchy of year/month/date?
Thank you for writing to us.
Flexmonster supports the ISO 8601 date format, for example:
"2016-03-20" (just date) or
"2016-03-20T14:48:00" (date and time).
The same date format is supported for Flexmonster Data Server.
Here is an example of CSV data with dates in the format that Flexmonster Data Server will recognize:
Regarding hierarchical date types:
Multi-level dates are not supported for Flexmonster Data Server (custom data source API). That is why
"date" fields are represented as
"date string". Still, all the specific filtering and sorting by dates are available for the
"date string" data type.
If splitting dates into three fields is critical for some of your datasets, you can try using JSON/CSV instead of the Flexmonster Data Server as a workaround. For example, you could replace the data provider only for some datasets containing dates that need to be split.
Alternatively, it is possible to create your own multilevel dates (like
"year/month/day") by combining separate fields (for example,
"Day") into a multilevel hierarchy (see tutorial).
Please let us know if this helps.
thanks for the quick answer. I am using now date(fieldname) to get a value that is working with flexmonster. But an issue right now is, that when the field has a value of null, the report shows "invalid date". Which is not right. The date is not invalid, it is just empty. So I am not sure what to do about that.
Would be great if you could help me with that.
I found the answer with global object, which works fine.
Thank you for the update.
We are happy to hear that everything worked.
"invalid date" text can be customized through the
As always, feel free to reach out to us should further questions arise.