-
Type: Bug
-
Status: Resolved
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: 9.10
-
Fix Version/s: 10.10-HF35, 11.4, 2021.0
-
Component/s: Template Rendering
At https://github.com/nuxeo/nuxeo/blob/master/addons/nuxeo-template-rendering/nuxeo-template-rendering-core/src/main/java/org/nuxeo/template/context/extensions/ContextFunctions.java#L164 the dt object is not used to format the date. For the moment the SimpleDateFormat.format method tries to format a Calendar Object which is not supported argument for this method so the following error is thrown :
java.lang.IllegalArgumentException: Cannot format given Object as a Date
at java.base/java.text.DateFormat.format(DateFormat.java:338)
at java.base/java.text.Format.format(Format.java:158)
at org.nuxeo.template.context.extensions.ContextFunctions.formatDate(ContextFunctions.java:164)
at org.nuxeo.template.context.extensions.ContextFunctions.formatDate(ContextFunctions.java:140)