1 of 1 people found this helpful
try like this,
add these properties datePattern="dd/MM/yyyy" enableManualInput="true" in rich:calendar and in your text box you try to enter like this 15/08/2010.it will accept the date.
Your answer to my question is helpful answer;Thanks for nice reply.
Please, can you tell me how i will achieve my requiement?? Below is my Question.
Q: Here is my functionality, I need to enter a date in calendar component text field like (31082010) after any event like(Onblur or
OnEnterkeyPress event) the entered date should change into the user defined format (31-Aug-2010). How to achieve this functionality??
[ I have a calendar bean i need to enter inside i have a variable called 'datePattern="dd-MMM-yyyy"' so based upon date pattern specified in
the class or bean displayed into the calendar component text field ]. I think you understand my question.....
so catch the events in which you interestedto and parse the input value with your custom js function. (API for example to set parsed value calendar - listed at richfaces-demo and should be in reference.)
I am looking for a way to control pattern of date. Something like this selectDate(date,noUpdate,eventData, pattern) or setPattern(pattern).
The ultumate goal is to have user eather type the date in (enableManualInput=true) or let user select the date from popup calendar. Once user start typing the date we can start guessing the pattern, if it is 4 digits we can assume it is 'yyyy' and so on.
setting it from JS even if would be possible - will not be reflected at server side. So how will you convert it there? I'm afraid you can't achieve such dynamic pattern support.