You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Mark van Leeuwen <ma...@internode.on.net> on 2007/07/28 08:49:21 UTC

RE: [Wicket-user] Setting date format with the DateTimeFieldcomponent

I saw that method but the member variable dateField (having class
DateTextField) within DateTimeField is private and there is no getter for it
so I cannot change the pattern.

At this point it looks like I would have to clone DateTimeField so I can
make the change.

Unless I am missing something...

Mark


-----Original Message-----
From: wicket-user-bounces@lists.sourceforge.net
[mailto:wicket-user-bounces@lists.sourceforge.net] On Behalf Of Gerolf Seitz
Sent: Saturday, 28 July 2007 3:14 PM
To: Deprecated! Please subscribe to users-subscribe@wicket.apache.org
Subject: Re: [Wicket-user] Setting date format with the
DateTimeFieldcomponent

take a look at the DateTextField#forDatePattern(...) methods

hth,
  gerolf

On 7/28/07, Mark van Leeuwen <ma...@internode.on.net> wrote:
>
> Hi all,
>
> How can I set the date format with the DateTimeField? Looking at the code,
> the format appears to be set in DateTimeField.init() with the line:
>
> add(dateField = DateTextField.forShortStyle("date", new
> PropertyModel(this,
> "date")));
>
> and there seems no simple way to override this behaviour. It defaults to
> MM/dd/yyyy whereas I want yyyy/MM/dd.
>
> Thanks in advance
> Mark
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >>  http://get.splunk.com/
> _______________________________________________
> IMPORTANT NOTICE:
>
> This mailing list is shutting down. Please subscribe to the Apache Wicket
> user list. Send a message to: "users-subscribe at wicket.apache.org" and
> follow the instructions.
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
IMPORTANT NOTICE:

This mailing list is shutting down. Please subscribe to the Apache Wicket
user list. Send a message to: "users-subscribe at wicket.apache.org" and
follow the instructions.
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

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


Re: [Wicket-user] Setting date format with the DateTimeFieldcomponent

Posted by Eelco Hillenius <ee...@gmail.com>.
On 7/27/07, Mark van Leeuwen <ma...@internode.on.net> wrote:
> I saw that method but the member variable dateField (having class
> DateTextField) within DateTimeField is private and there is no getter for it
> so I cannot change the pattern.
>
> At this point it looks like I would have to clone DateTimeField so I can
> make the change.

I added overridable method newDateTextField to both DateField and
DateTimeField so that you can provide construct the date text field in
your own way. Type is still DateTextField though. I didn't see a big
advantage to being more generic than that.

Eelco

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