I have an inputText where the user must insert an hour in the format HH:mm (so with the hours within 00 and 23, not AM-PM). I've tried two ways to check what the user enters:
1) Using convertDateTime:
It works for the checks on the hour, but the value of "time" (which is defined by me as a String type) in the bean is not saved as HH:mm but as a full datetime, like "Monday, May 14, 2007 2:39:56 PM" (I've also tried using timeStyle="short" instead of defining the pattern)
I'm italian and I've started using JSF a week ago so I'm not very skilled about that...please, answer in a simple wayyy! Thank you
You will have better fortune, I think if you make the "export.time" property be a java.util.Date object instead of a string. This will require some back-end Calendar logic to get/set the String version of the date, but it will interact better with the JSF date formatting and conversion functions.
An IDE is no substitute for an Intelligent Developer.
Joined: Nov 09, 2011
Thank you for your welcome! Grazie
Oooh, I didn't think about that! I've tried right now and it's working perfectly! I just had to convert to and by string as you said and to put the "HH:mm" pattern in the outputTexts to make it show just the hour and it's correct now! Thank you so much for your help