Playframework 2.X and date format in scala template

How do you display a Date object according to your desired template in a Playframework 2.X template?

public class Job { public Date date } 

When I show @ job.date in a scala template, I have the following displayed:

 Tue Nov 19 12:49:46 WST 2013 

Expected:

 19 Nov 

Important: The date object is specified using the new date (). I do not want to change the template when setting the date object, I want to display only the date with the template of my choice in the view. Is it possible?

Thank you very much

+6
source share
1 answer

In the scala template:

 @job.date.format("dd MMM") 
+13
source

Source: https://habr.com/ru/post/958361/


All Articles