You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Steve Swinsburg <s....@lancaster.ac.uk> on 2008/10/27 17:08:07 UTC
birthday dropdown with month/leap year variances
Hi all,
I am creating a set of dropdown choices for a user to enter their
birthday on a profile. One for day of the month, one for month of the
year, and one for year. However I want to be able to take into account
months that have differing numbers of days, (ie some 30, some 31, some
28, every now and the 29 etc) which is all dependent on the month and
if its a leap year or not.
Does anyone have a component/fragment of code that handles this
already to save reinventing the wheel?
cheers,
Steve
Re: birthday dropdown with month/leap year variances
Posted by Ryan Gravener <ry...@ryangravener.com>.
A simple way would be to use
http://wicketstuff.org/wicket13/dates/
with the settings used on
http://developer.yahoo.com/yui/examples/calendar/calnavigator.html
Ryan Gravener
http://ryangravener.com/flex | http://twitter.com/ryangravener
On Mon, Oct 27, 2008 at 12:08 PM, Steve Swinsburg <
s.swinsburg@lancaster.ac.uk> wrote:
> Hi all,
>
> I am creating a set of dropdown choices for a user to enter their birthday
> on a profile. One for day of the month, one for month of the year, and one
> for year. However I want to be able to take into account months that have
> differing numbers of days, (ie some 30, some 31, some 28, every now and the
> 29 etc) which is all dependent on the month and if its a leap year or not.
>
> Does anyone have a component/fragment of code that handles this already to
> save reinventing the wheel?
>
>
>
> cheers,
> Steve
>
>
>
>
>
>
>
Re: birthday dropdown with month/leap year variances
Posted by Piller Sébastien <pi...@hmcrecord.ch>.
Maybe you can just rely on Calendars, which provides
Calendar#getMaximum(Calendar.DAY_OF_MONTH)
It is not really reinventing the wheel, just using the available api and
combine
Steve Swinsburg a écrit :
> Hi all,
>
> I am creating a set of dropdown choices for a user to enter their
> birthday on a profile. One for day of the month, one for month of the
> year, and one for year. However I want to be able to take into account
> months that have differing numbers of days, (ie some 30, some 31, some
> 28, every now and the 29 etc) which is all dependent on the month and
> if its a leap year or not.
>
> Does anyone have a component/fragment of code that handles this
> already to save reinventing the wheel?
>
>
>
> cheers,
> Steve
>
>
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org