I did this and it worked.

txtStartDate = new DateTextField("txtStartDate", new
Model<Date>(startDate.toDate()),"dd-MMM-yyyy");

josh.

On Fri, Feb 5, 2010 at 12:22 PM, Peter Thomas <[email protected]> wrote:

> On Fri, Feb 5, 2010 at 2:42 PM, Josh Kamau <[email protected]> wrote:
>
> > Hi guys;
> >
> > I am getting frustrated trying to display date in the format
> "dd-MMM-yyyy"
> > e.g 05-FEB-2010.
> >
> > i am using a TextField<Date> and a
> > org.apache.wicket.extensions.yui.calendar.DatePicker . I have added the
> > date
> > picker to the textfield as required.
> >
> > After i pick the date from the datepicker popup, i want to to insert the
> > date in the above format. I have tried writting a converter, overriding
> the
> > get/setModelObject on the textfield among other things but it wont work.
> > Anyone suggest a different date picker component that i can use?
> >
>
> You can try roll your own picker using YUI, here's some code I wrote that
> does this:
>
>
> http://fisheye3.atlassian.com/browse/j-trac/trunk/jtrac/src/main/java/info/jtrac/wicket/yui/YuiCalendar.java?r=HEAD
>
>
> http://fisheye3.atlassian.com/browse/j-trac/trunk/jtrac/src/main/webapp/resources/yui/calendar/calendar-utils.js?r=HEAD
>
> I had to use some extra JS (see link above) to set the format on the YUI
> side, hope this helps.  Disclaimer: code is a little old though, old
> version
> of YUI, referencing JS from context relative path not really recommended -
> prefer relative to java package etc.
>
> - Peter
>
>
>
> >
> > regards.
> >
> > Josh
> >
> > On Fri, Feb 5, 2010 at 11:25 AM, Josh Kamau <[email protected]>
> wrote:
> >
> > > Hi guys;
> > >
> > > Kindly help me set the application-wide date format independent of the
> > > locale.
> > >
> > >
> > > regards.
> > >
> >
>

Reply via email to