Controlling date formats in feature templates

Hi All,

I’m using feature templates to generate JSON-LD formatted output for feature types sourced from an Oracle database. Data that are of type DATE in the Oracle tables are presented as a full timestamp when implemented as a simple property interpolation in the feature template. E.g. “DATE_LAST_VISITED”: “${DATE_LAST_VISITED}” in the feature template results in “DATE_LAST_VISITED” : “2020-08-17T14:00:00.000+00:00” in the JSON-LD and GeoJSON output for the template.

WFS output formats generated without using the feature template, e.g. GeoJSON, GML, KML etc provide the dates in a shortened “yyyy-MM-dd” format, e.g. “2020-08-17”. This is the preferred format for my use cases.

I’ve tried using the dateFormat function in a cql evaluation to apply the required format, e.g. “DATE_LAST_VISITED”: “$${dateFormat(DATE_LAST_VISITED, ‘yyyy-MM-dd’)}!”, although a null is always returned.

A workaround that I stumbled on is to apply a string function in the cql evaluation which gives the " yyyy-MM-dd " format, e.g. “DATE_LAST_VISITED”: “$${strTrim(DATE_LAST_VISITED)}”. Other string functions such as strToUpperCase and strToLowerCase give the same result.

I’m wondering if there’s a more predictable way of controlling the format of date values in the feature templates, as well as being able to control the date formats when feature templates and freemarker templates are not used (in cases where a format other than “yyyy-MM-dd” is required).

Regards,

Aaron.