From what I see in the auto-generated file application.conf, the dates / times in the Play Framework 2.2 are formatted as defined date.formatin this file. For example, I defined
date.format=yyyy-MM-dd
date.format.dk=d. MMMM yyyy
These values, however, are apparently ignored by the framework when printing dates in Scala templates. This thread provides a solution in which you get into the template directly into the template as myDate.format("yyyy-MM-dd"). (If you use Jodatime, I think it becomes myDate.toDate().format("yyyy-MM-dd")because it is DateTimenot in the class format().) But it not only forces the template to be repeated every time the date is displayed, but also ignores the current locale.
So, what is the intended way to format date and time in Play Framework 2.2.x for different locales?
plade source
share