String sdate="24-01-2012"; //24 Jan 2012 DateTimeFormat dformat = DateTimeFormat.getFormat("dd-MM-yyyy"); DateField date2 = new DateField(); date2.getPropertyEditor().setFormat(dtFormat); Date dDate= dformat.parse(sdate); date2.setValue(
dDate
);
Malaya Merdeka - from Ash's vinyl collection
9 months ago
1 comments:
Thanks for the post, it was very usefull.
There is a little error:
date2.getPropertyEditor().setFormat(dtFormat);
should be:
date2.getPropertyEditor().setFormat(dformat);
Post a Comment