You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Charbel Abdul-Massih <ca...@soundbite.com> on 2007/03/27 20:13:07 UTC

f:convertDateTime - CAN you have 2 patterns?

I have the following inputText

 

<h:inputText value="#{someDate}"  id="endDate">

      <f:convertDateTime pattern="MM/dd/yyyy" />

</h:inputText>

 

However, I want the application to also recognize the pattern
"MM/dd/yy"...

Is it possible to specify two date patterns and have JSF convert them
both correctly?????

 

Thanks,

Charbel


Re: f:convertDateTime - CAN you have 2 patterns?

Posted by Matthias Wessendorf <ma...@apache.org>.
http://incubator.apache.org/adffaces/trinidad-api/tagdoc/tr_convertDateTime.html

On 3/27/07, Simon Lessard <si...@gmail.com> wrote:
> Hello,
>
> You can also consider using Trinidad, its date converter supports a primary
> and secondary pattern.
>
>
> Regards,
>
> ~ Simon
>
>
> On 3/27/07, Mike Kienenberger <mk...@gmail.com> wrote:
> > You'd need to write your own converter.
> > Subclass the standard JSF date converter, then override getAsObject()
> > to also try inputPattern2="yyyy-MM-dd's value if pattern didn't work.
> >
> >
> > On 3/27/07, Charbel Abdul-Massih < cabdulmassih@soundbite.com> wrote:
> > >
> > >
> > >
> > >
> > > I have the following inputText
> > >
> > >
> > >
> > > <h:inputText value="#{someDate}"  id="endDate">
> > >
> > >       <f:convertDateTime pattern="MM/dd/yyyy" />
> > >
> > > </h:inputText>
> > >
> > >
> > >
> > > However, I want the application to also recognize the pattern
> "MM/dd/yy"…
> > >
> > > Is it possible to specify two date patterns and have JSF convert them
> both
> > > correctly?????
> > >
> > >
> > >
> > > Thanks,
> > >
> > >  Charbel
> >
>
>


-- 
Matthias Wessendorf
http://tinyurl.com/fmywh

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

Re: f:convertDateTime - CAN you have 2 patterns?

Posted by Simon Lessard <si...@gmail.com>.
Hello,

You can also consider using Trinidad, its date converter supports a primary
and secondary pattern.


Regards,

~ Simon

On 3/27/07, Mike Kienenberger <mk...@gmail.com> wrote:
>
> You'd need to write your own converter.
> Subclass the standard JSF date converter, then override getAsObject()
> to also try inputPattern2="yyyy-MM-dd's value if pattern didn't work.
>
>
> On 3/27/07, Charbel Abdul-Massih <ca...@soundbite.com> wrote:
> >
> >
> >
> >
> > I have the following inputText
> >
> >
> >
> > <h:inputText value="#{someDate}"  id="endDate">
> >
> >       <f:convertDateTime pattern="MM/dd/yyyy" />
> >
> > </h:inputText>
> >
> >
> >
> > However, I want the application to also recognize the pattern
> "MM/dd/yy"…
> >
> > Is it possible to specify two date patterns and have JSF convert them
> both
> > correctly?????
> >
> >
> >
> > Thanks,
> >
> >  Charbel
>

Re: f:convertDateTime - CAN you have 2 patterns?

Posted by Mike Kienenberger <mk...@gmail.com>.
You'd need to write your own converter.
Subclass the standard JSF date converter, then override getAsObject()
to also try inputPattern2="yyyy-MM-dd's value if pattern didn't work.


On 3/27/07, Charbel Abdul-Massih <ca...@soundbite.com> wrote:
>
>
>
>
> I have the following inputText
>
>
>
> <h:inputText value="#{someDate}"  id="endDate">
>
>       <f:convertDateTime pattern="MM/dd/yyyy" />
>
> </h:inputText>
>
>
>
> However, I want the application to also recognize the pattern "MM/dd/yy"…
>
> Is it possible to specify two date patterns and have JSF convert them both
> correctly?????
>
>
>
> Thanks,
>
>  Charbel