ellou' Thomas
Accidentally (or not) date formatting is the same :), check the sample applications ie.: computer database, view list.scala.html -
@computer.introduced or @computer.discontinued
W dniu sobota, 12 maja 2012 14:30:59 UTC+2 użytkownik Thomas Vervik napisał:I have a arrangment object with a date field, and wants to format the date something like this:
de facto you do not need extra method for formating the code:
<div class="dateBox">
<div class="day">@arrangement.date.format("dd")</div>
<div class="month">@arrangement.date.format("MMMM")</div>
<div class="year">@arrangement.date.format("yyyy")</div>
</div>
Play 1.x had JavaExtension where you could write your own extensions, but this isnt presents in Play 2.0 as far as I can see from the documention or by seaching the classes *JavaExtension" inside Idea
In Play 2 you can also create tags and/or "JavaExtension"-like calls, as each template is just a Scala function,
you can easily call your methods of your classes.