Hello,
In a Date field, is it possible to have the user selection of hours to be between 1 and 12 instead of 0 and 11?
I currently have the following code for a Date field to allow the user to select a date and time:
// Create a DateField with the calendar style.
final DateField fromDate = new DateField("From:");
fromDate.setResolution(DateField.RESOLUTION_SEC);
System.out.println(fromDate.getValue());
// Set the date and time to present.
fromDate.setValue(new java.util.Date());
fromDate.setDateFormat("dd/MM/yyyy hh:mm:ss aaa");
fromDate.setInvalidAllowed(false);
As you can see, I am using setDateFormat and specifying “hh” which puts it in the 1-12 format when it’s displayed (after selection), but during selection the user still sees 0-11.
Below is a screenshot:
Any ideas?
Thanks,
Ajay