You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Jakob Korherr <ja...@gmail.com> on 2009/12/21 20:25:03 UTC

Re: how to restrict inputDate to be the 1st date of each month within a range of date

Hi,

Why do you want to select only the 1st day of each month? do you want to
select a month with this component? If so, why don't you just use two
<h:selectOneMenu> components, one for the month and one for the year?

Regards,

Jakob Korherr

2009/12/18 <lw...@att.net>

>  Hi,
>  with the following code, I don't think it suits my need.  Please advise if
> there is way to achieve only allowing 1st day of each month within a certain
> range, say within Oct 15, 2008 - Oct 30, 2010 to be selectable.  If this is
> not possible, backend validation is the only choice.
>
>  <tr:inputDate id="days" value="#{bean.date}"
>                                   label="Select a date, but check possible
> holidays first">
>                 <tr:convertDateTime pattern="yyyy-MM-dd"/>
>                 <tr:validateDateRestriction
> invalidDays="#{bean.date.nationalHolidays}" />
>               </tr:inputDate>
>

Re: how to restrict inputDate to be the 1st date of each month within a range of date

Posted by Maurice Kienenberger <mk...@gmail.com>.
Probably because it's easier to pick using one component than two.

Maybe he could try using

    <tr:convertDateTime pattern="yyyy-MM"/>

and see if that will automatically set the day part to 01 no matter
which day is picked.

If he wanted something different,  another option is an
h:selectOneMenu that listed yyyy-MM rather than two separate
components.

On Mon, Dec 21, 2009 at 2:25 PM, Jakob Korherr <ja...@gmail.com> wrote:
> Hi,
>
> Why do you want to select only the 1st day of each month? do you want to
> select a month with this component? If so, why don't you just use two
> <h:selectOneMenu> components, one for the month and one for the year?
>
> Regards,
>
> Jakob Korherr
>
> 2009/12/18 <lw...@att.net>
>
>>  Hi,
>>  with the following code, I don't think it suits my need.  Please advise if
>> there is way to achieve only allowing 1st day of each month within a certain
>> range, say within Oct 15, 2008 - Oct 30, 2010 to be selectable.  If this is
>> not possible, backend validation is the only choice.
>>
>>  <tr:inputDate id="days" value="#{bean.date}"
>>                                   label="Select a date, but check possible
>> holidays first">
>>                 <tr:convertDateTime pattern="yyyy-MM-dd"/>
>>                 <tr:validateDateRestriction
>> invalidDays="#{bean.date.nationalHolidays}" />
>>               </tr:inputDate>
>>
>