Change date language in Thymeleaf 2.1.5

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Change date language in Thymeleaf 2.1.5

YLombardi
Hi,

I use Thymeleaf 2.1.5 in my project and I use ${#calendars.format(myDate,'E ')} to format my dates.
It displays myDate like this :
mar. 16/05/2017 - 00:00 (with a french browser)
Tue 16/05/2017 - 00:00 (with an english browser)
In my application, the user can choose the language that he preferes.
I need to format dates in the language that the user choose.
Is it possible to force the language in which Thymleaf will format the date instead of using the browser language ?
Java Developper at Geodis (France)