don't changed date format('MM dd, yyyy') ?
Hi All
i want to change data format(MM dd,yyyy -> yyyy-MM-dd).
my Roo Version is 1.0.0.RC1 and my action is...
1. domain field command in Roo shell
add field date jpa -class ~.domain.Foo -fieldName regDate -type java.util.Date
2. FooController_Roo_Controller.aj
@org.springframework.web.bind.annotation.InitBinde r
public void AccountController.initBinder(org.springframework.w eb.bind.WebDataBinder binder)
{
binder.registerCustomEditor(java.util.Date.class, new org.springframework.beans.propertyeditors.CustomDa teEditor(new java.text.SimpleDateFormat("MM dd, yyyy"), false));
}
3. create.jsp
<script type="text/javascript">Spring.addDecoration(new Spring.ElementDecoration({elementId : '_regDate', widgetType : 'dijit.form.DateTextBox', widgetAttrs : {constraints: {datePattern : 'MM dd, yyyy', required : false}, datePattern : 'MM dd, yyyy'}})); </script>
it(dateformat) is fixed. not changed. if it was hard coding, it would be roo shell rewrited :(
so, my opinion is...
1. add option shell command
add field date jpa -class ~.domain.Foo
-fieldName regDate -type java.util.Date
-format yyyy-MM-dd
2. add attribute for @RooWebScaffold
@RooWebScaffold(
automaticallyMaintainView = true, formBackingObject = Foo.class, initBinder.dateFormat='yyyy-MM-dd')
thank you for read.
sorry, So shot English :)