You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by María del Busto Griñón <ma...@gmail.com> on 2014/02/06 15:46:30 UTC

Datepicker to pick just the month

Hi,

I am developing a webapp where at some certain point we need to pick just
the month of a date. I have tried to create a DatePicker with date format =
"MMMM", and it works ok when it loads the date from the Database, if the
month of the date stored is february, for example, it renders "February"
correct, but if I try to pick another month, for example March, then in the
date field it shows 03 and it shows an error pointing that the date format
is not correct.

Isn't it allowed to use the "MMMM" format? "MMM" doesn't work either...

Thanks!

Re: Datepicker to pick just the month

Posted by María del Busto Griñón <ma...@gmail.com>.
Well that doesn't seem to be right, because it says that date formats are:


   - d, dd: Numeric date, no leading zero and leading zero, respectively.
   Eg, 5, 05.
   - D, DD: Abbreviated and full weekday names, respectively. Eg, Mon,
   Monday.
   - m, mm: Numeric month, no leading zero and leading zero, respectively.
   Eg, 7, 07.
   - M, MM: Abbreviated and full month names, respectively. Eg, Jan, January
   - yy, yyyy: 2- and 4-digit years, respectively. Eg, 12, 2012.

But if I set "MM" it outputs 02 instead of "February", the date formats
that it is using are those of SimpleDateFormat..



2014-02-06 16:14 GMT+01:00 Martin Grigorov <mg...@apache.org>:

> Hi,
>
> I assume you use wicket-datetime module.
> You will have to consult with YUI 2.x docs to see what is supported -
> http://yui.github.io/yui2/
>
> https://github.com/l0rdn1kk0n/wicket-bootstrap uses this datepicker -
> http://bootstrap-datepicker.readthedocs.org/en/latest/options.html#format
>
> Wicket JQuery UI project provides integration with JQuery UI datepicker.
>
> Martin Grigorov
> Wicket Training and Consulting
>
>
> On Thu, Feb 6, 2014 at 3:46 PM, María del Busto Griñón <
> maria.delbusto@gmail.com> wrote:
>
> > Hi,
> >
> > I am developing a webapp where at some certain point we need to pick just
> > the month of a date. I have tried to create a DatePicker with date
> format =
> > "MMMM", and it works ok when it loads the date from the Database, if the
> > month of the date stored is february, for example, it renders "February"
> > correct, but if I try to pick another month, for example March, then in
> the
> > date field it shows 03 and it shows an error pointing that the date
> format
> > is not correct.
> >
> > Isn't it allowed to use the "MMMM" format? "MMM" doesn't work either...
> >
> > Thanks!
> >
>

Re: Datepicker to pick just the month

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

I assume you use wicket-datetime module.
You will have to consult with YUI 2.x docs to see what is supported -
http://yui.github.io/yui2/

https://github.com/l0rdn1kk0n/wicket-bootstrap uses this datepicker -
http://bootstrap-datepicker.readthedocs.org/en/latest/options.html#format

Wicket JQuery UI project provides integration with JQuery UI datepicker.

Martin Grigorov
Wicket Training and Consulting


On Thu, Feb 6, 2014 at 3:46 PM, María del Busto Griñón <
maria.delbusto@gmail.com> wrote:

> Hi,
>
> I am developing a webapp where at some certain point we need to pick just
> the month of a date. I have tried to create a DatePicker with date format =
> "MMMM", and it works ok when it loads the date from the Database, if the
> month of the date stored is february, for example, it renders "February"
> correct, but if I try to pick another month, for example March, then in the
> date field it shows 03 and it shows an error pointing that the date format
> is not correct.
>
> Isn't it allowed to use the "MMMM" format? "MMM" doesn't work either...
>
> Thanks!
>