Bug: formatting of dates in templates
Our TemplatingServiceImpl does not handle {{formatDate}} correctly when the format code contains a whitespace like dd/MM/yyyy HH:mm:
java.time.format.DateTimeParseException: Text 'HH:mm 2025-10-27T20:05:08.956375Z' could not be parsed at index 0
at java.base/java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:2046) ~[?:?]
at java.base/java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1948) ~[?:?]
at org.gringlobal.service.impl.TemplatingServiceImpl.parseDate(TemplatingServiceImpl.java:191) ~[classes/:?]
at org.gringlobal.service.impl.TemplatingServiceImpl.formatDate(TemplatingServiceImpl.java:206) ~[classes/:?]
The date "value" will always be a UTC-style string without whitespace, but we're splitting by the first . Please update the function in src/main/java/org/gringlobal/service/impl/TemplatingServiceImpl.java:
private static String formatDate(String input) {
if (StringUtils.isBlank(input)) return "";
input = StringUtils.trim(input);
// TODO Use regexp to get the pattern and timestamp