DateBox formatting help

28 views
Skip to first unread message

Vik

unread,
Jan 3, 2012, 7:48:18 AM1/3/12
to google-we...@googlegroups.com
Hie

I want that on selecting a value from date picker it should be stored at DD/MMM/YYYY format. Not able to find a way. I tried like:

DateBox dateOfBirth = new DateBox();
 dateOfBirth.addValueChangeHandler(new ValueChangeHandler<Date>(){

@Override
public void onValueChange(ValueChangeEvent<Date> event) {
   DefaultFormat format = new DateBox.DefaultFormat();
   dateOfBirth.setValue(format.parse(dateOfBirth, "dd/mmm/yyyy", true));
}});


Please advise.

Thankx and Regards

Vik
Founder
http://www.sakshum.org
http://blog.sakshum.org

Thomas Broyer

unread,
Jan 3, 2012, 8:08:50 AM1/3/12
to google-we...@googlegroups.com
dateOfBirth.setFormat(new DateBox.DefaultFormat(DateTimeFormat.getFormat("dd/MMM/yyyy")))

Vik

unread,
Jan 4, 2012, 6:47:07 AM1/4/12
to google-we...@googlegroups.com
Thanks a lot!
On Tue, Jan 3, 2012 at 6:38 PM, Thomas Broyer <t.br...@gmail.com> wrote:
dateOfBirth.setFormat(new DateBox.DefaultFormat(DateTimeFormat.getFormat("dd/MMM/yyyy")))

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/QnGvDAjLJ6gJ.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Reply all
Reply to author
Forward
0 new messages