• Post Reply Bookmark Topic Watch Topic
  • New Topic

validate convertDateTime

 
rosaria italia
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello I have this code:
<h:inputText id="data" value="#{uBean.data1}">
<f:convertDateTime pattern="dd-MM-yyyy" dateStyle="full"/>
</h:inputText>
Why if I write in "input text" one day wrong or one month wrong, validation generates a format error and if I write one year wrong, validation doesn't shows validation error?

If I write 12-13-1989 shows format error.
If I write 12-12-198 doesn't shows format error.

How do I do to generate error also for year?

Thanks
 
Henrique Sousa
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems everything is right. After all, year 198 is valid. I don't remember what happened then, but it certainly is part of planet Earth's history. On the other hand, month 13 does not exist in our gregorian calendar. You see, the problem is not about the correctness of the date itself, but the correctness of its meaning. So you need validation for that date, perhaps by implementing a javax.faces.validator.Validator; at least that is my suggestion. Good luck
 
Henry Lowell
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Henrique Sousa:
It seems everything is right. After all, year 198 is valid. I don't remember what happened then, but it certainly is part of planet Earth's history.


I rememeber what happened. Everyone started freaking out about the year 200 and the fact that none of their scrolls were compliant. It was chaos. Goats were slaughtered and stored in shelters along with mass amounts of water in case the world ended.
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Remember "Party like it's 199"?

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!