This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes JSF and the fly likes Date Validation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Date Validation" Watch "Date Validation" New topic
Author

Date Validation

Vidu Greg
Greenhorn

Joined: Sep 05, 2005
Posts: 10
Hi

I am having a problem in this. I dont want a user to pick a previous date so I am having minimum "now".

<h:inputText value="#{myBean.effectiveDate}" id="effectiveDate">
<f:convertDateTime type="date" pattern="MM/dd/yyyy"/><hx:inputHelperDatePicker />
<hx:validateDateTimeRange minimum="#{now}" />
</h:inputText>

but the problem is when user enters today's date, it validate time also and then gives validation error because by default the time is 12 PM and if user is trying after 12 PM, it will give validation error. I am using a pattern also but still having problem.

thanks in advance.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60077
    
  65

"vd grg",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
JavaRanch Sheriff


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Date Validation
 
Similar Threads
validate convertDateTime
f:convertDateTime issue
Refresh values of JSF page before validation occurs
replacing default validator message at h:messages
How to show a single error message for all fields