You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Adam Brod <AB...@intralinks.com> on 2006/07/20 15:31:17 UTC

Can I set default f:convertDateTime dateStyle?

Hi-

We display dates all over our site with a "short" dateStyle.  Is there a 
way I can change the default value for the f:convertDateTime dateStyle?  I 
really don't want to have to put <f:convertDateTime type="date" dateStyle=
"short" /> in lots of places all over my pages.

Thanks for any tips!

Adam Brod
Product Development Team

Disclaimer: This electronic mail and any attachments are confidential and may be privileged. If you are not the intended recipient, please notify the sender immediately by replying to this email, and destroy all copies of this email and any attachments. Thank you.

Re: Can I set default f:convertDateTime dateStyle?

Posted by Matthias Wessendorf <ma...@apache.org>.
You can extend JSF's DateTimeConverter, overwrite dateStyle.
Then you must config it in your faces-config.

like

<converter>
  <converter-for-class>
  	java.util.Date
  </converter-for-class>
  <converter-class>
  	com.mybiz.MyDateTimeConverter
	</converter-class>
</converter>

-Matthias

On 7/20/06, Adam Brod <AB...@intralinks.com> wrote:
>
> Hi-
>
> We display dates all over our site with a "short" dateStyle.  Is there a way
> I can change the default value for the f:convertDateTime dateStyle?  I
> really don't want to have to put <f:convertDateTime type="date"
> dateStyle="short" /> in lots of places all over my pages.
>
> Thanks for any tips!
>
>  Adam Brod
>  Product Development Team
>  Disclaimer: This electronic mail and any attachments are confidential and
> may be privileged. If you are not the intended recipient, please notify the
> sender immediately by replying to this email, and destroy all copies of this
> email and any attachments. Thank you.
>
>
>


-- 
Matthias Wessendorf

further stuff:
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com