Make Date Format Configurable

4 views
Skip to first unread message

glaucon6

unread,
Feb 25, 2009, 3:35:43 PM2/25/09
to gwt-datepicker
I really like the widget and how it is styled. I had one issue with
the way things are set up, though. The only way I found to change the
default date format was to open the jar file, extract DateLocale_.java
and change the getDateTimeFormat() method. I understand that you have
it set up to return a default formatting for each locale, but I'm less
interested in the locale-specific formatting and more interested in
just being able to configure the format to be whatever I want. In my
case, I did the following:

//DateTimeFormat format = DateTimeFormat.getFormat("MM/dd/yyyy");
DateTimeFormat format = DateTimeFormat.getFormat("EEEE, MMM d, yyyy");

This works, but I wanted to know if I'm missing something. Also, I
understand that if I changed locales I'd end up back where I started
with a default format in the other locale, since a different
DateLocale_*.java would be used. What are your thoughts on adding a
setDateFormat(String format) method to DateLocale?
Reply all
Reply to author
Forward
0 new messages