Date Field selecting hours between 1-12 instead of 0-11?

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

Hi Ajay,

0-11 (or 0-23 when using 24 hour clock) seems to be hardcoded into the datefield component and I see no way you could change that without making an own datefield component. Feel free to create a ticket about this at
http://dev.itmill.com
.