I m using a rich:calendar to display Date in my application
But some how date validation isn’t working properly in a particular scenario.
i.e it some one enters date as 05/05/2010sfc in this case it automatically trims the extra characters in the end
and displays date properly in next page instead of giving an error of invalid date on same page.
It works in other cases such as asd05/05/2010, 05sfa/05/2010, etc
I tried using but it didn’t help
Can anyone please help me on this…
That’s indeed how
SimpleDateFormat(which it is using under the hoods) by default works.Best what you can do is to restrict the input field max length to 10 or supply a custom date validator.