The transition from a fixed server-side controller-level date pattern definition (formerly defined by the @RooWebScaffold(dateFormat="MM/dd/yyyy") attribute) towards a more flexible approach is completed with rev 512).
As a result the RooWebScaffold.dateFormat attribute has been removed from the annotation as well as the controller command.
Roo will now include the new Spring MVC @DateTimeFormat annotation by default to all fields of type java.util.Date or java.util.Calendar. Roo will recognize the 'style' attribute of that annotation and if a Web layer is scaffolded it will decorate the corresponding form field with a Spring JS/Dojo date picker. The form field decoration with a date picker will only take place if the format style chosen for date or time is either SHORT or MEDIUM. The first style character defines date forma and the second defines the time format:
@DateTimeFormat(style="S-") Calendar birthDay;
@DateTimeFormat(style="MS") Date productionDateTime;
The actual date format rendered by the Dojo date picker depends on the locale selected by the user in the browser. For example selecting an English locale results the following date pattern: MM/dd/yyyy whereas selecting the German locale results in the following pattern: dd.MM.yyyy
Finally, the field command now allows you to specify the date and time patterns with the dateFormat and timeFormat attributes:
field date --fieldName productionDateTime --type java.util.Calendar --dateFormat MEDIUM --timeFormat SHORT
The dateFormat and timeFormat attributes are optional. Not specifying them defaults in dateFormat SHORT and timeFormat NONE.