citerus / dddsample-core

This is the new home of the original DDD Sample app (previously hosted at sf.net)..
MIT License
4.94k stars 1.47k forks source link

Move date formatting from templates to backend #60

Closed orende closed 1 year ago

orende commented 1 year ago

Why

We currently have logic in the Thymeleaf templates for formatting java.util.Date objects to strings. This makes the templates more complex and requires us to write acceptance-tests using WebDriver to verify the validity of the formatted dates.

What

This PR moves the formatting of the dates into the DTO assembler-classes in order to simplify the templates and allow us to verify the date formatting using simple unit tests.

(this PR was split out from #59)

mackapappa commented 1 year ago

After discussion we decided that the pros of keeping the date-format-logic in the templates outweigh the cons.