I created a function in Freemarker:
<#function formatDate anyDate>
<#assign dateFormat = read_from_configuration () />
<#if anyDate ??>
<#return anyDate? date (dateFormat) />
<#else>
<#return '' />
</ # if>
</ # function>
I call it this way: ${formatDate(object.someDate)} .
Everything works up to someDate . In this case, I get an exception:
Error executing macro: formatDate
required parameter: anyDate is not specified.
How can i do this? I want the function to work if the parameter values ββare zero.
Ula Krukar
source share