You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by gs...@apache.org on 2007/11/23 21:59:45 UTC
svn commit: r597736 -
/wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DateTimeField.java
Author: gseitz
Date: Fri Nov 23 12:59:43 2007
New Revision: 597736
URL: http://svn.apache.org/viewvc?rev=597736&view=rev
Log:
enhanced 12h/24h detection
Modified:
wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DateTimeField.java
Modified: wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DateTimeField.java
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DateTimeField.java?rev=597736&r1=597735&r2=597736&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DateTimeField.java (original)
+++ wicket/trunk/jdk-1.4/wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/DateTimeField.java Fri Nov 23 12:59:43 2007
@@ -42,7 +42,6 @@
import org.joda.time.MutableDateTime;
import org.joda.time.format.DateTimeFormat;
-
/**
* Works on a {@link java.util.Date} object. Displays a date field and a {@link DatePicker}, a
* field for hours and a field for minutes, and an AM/PM field. The format (12h/24h) of the hours
@@ -391,10 +390,9 @@
amOrPm = (date.get(DateTimeFieldType.halfdayOfDay()) == 0) ? AM_PM.AM : AM_PM.PM;
minutes = new Integer(date.getMinuteOfHour());
-
// we don't really have to reset the date field to the server's
- // timezone, as it's the same milliseconds from EPOCH anyway, and toDate
- // will always get the Date object initialized for the time zone
+ // timezone, as it's the same milliseconds from EPOCH anyway, and
+ // toDate will always get the Date object initialized for the time zone
// of the server
}
@@ -410,7 +408,8 @@
protected boolean use12HourFormat()
{
String pattern = DateTimeFormat.patternForStyle("-S", getLocale());
- return pattern.indexOf('a') != -1;
+ return pattern.indexOf('a') != -1 || pattern.indexOf('h') != -1 ||
+ pattern.indexOf('K') != -1;
}
/**