It may seem rather basic, but I'm looking for a reasonably simple way to
globally set how the application displays dates.  On rails, it was as
simple as setting that information in the l10n/i18n resource files.
I've been googling and trying to find the answer in the "Wicket in
Action" book, but it doesn't seem like it's something anyone's cared to
post the answer to.

At first I thought it was setting up a converter registered with the
java.util.Date class.  The instructions on the Wiki provide answers on
how to do that for wicket 1.1, 1.2, and 1.3.  I attempted the 1.3
solution, and my dates are not changed.  Here's what I have:
        
        @Override
        protected IConverterLocator newConverterLocator() {
            ConverterLocator converterLocator = new ConverterLocator();
            converterLocator.set(Date.class, new DateConverter() {
                        private static final long serialVersionUID =
194715223274764825L;

                        @Override
                public DateFormat getDateFormat(Locale locale) {
                        return new SimpleDateFormat("yyyy-MM-dd");
                }
            });
            return converterLocator;
        }

The date still is displayed like: 11/12/09 12:58 PM

Am I missing something?  Even more specifically, I would like to have
three styles I can switch between: date only, time only, and date and
time.  I'm trying not to repeat myself if I can help it.  I'd like to
default to "date only" and specify time or date/time when needed.  I
can't seem to get the system to recognize my date only solution.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to