directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r753472 - /directory/studio/trunk/valueeditors/src/main/java/org/apache/directory/studio/valueeditors/time/GeneralizedTimeValueDialog.java
Date Fri, 13 Mar 2009 23:12:41 GMT
Author: seelmann
Date: Fri Mar 13 23:12:40 2009
New Revision: 753472

URL: http://svn.apache.org/viewvc?rev=753472&view=rev
Log:
DIRSTUDIO-449: Retain the format of the original value

Modified:
    directory/studio/trunk/valueeditors/src/main/java/org/apache/directory/studio/valueeditors/time/GeneralizedTimeValueDialog.java

Modified: directory/studio/trunk/valueeditors/src/main/java/org/apache/directory/studio/valueeditors/time/GeneralizedTimeValueDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/valueeditors/src/main/java/org/apache/directory/studio/valueeditors/time/GeneralizedTimeValueDialog.java?rev=753472&r1=753471&r2=753472&view=diff
==============================================================================
--- directory/studio/trunk/valueeditors/src/main/java/org/apache/directory/studio/valueeditors/time/GeneralizedTimeValueDialog.java
(original)
+++ directory/studio/trunk/valueeditors/src/main/java/org/apache/directory/studio/valueeditors/time/GeneralizedTimeValueDialog.java
Fri Mar 13 23:12:40 2009
@@ -438,7 +438,7 @@
      */
     private void addUtcTimezone( String id, int rawOffset )
     {
-        TimeZone tz = new SimpleTimeZone( rawOffset, id );
+        TimeZone tz = rawOffset == 0 ? TimeZone.getTimeZone( "UTC" ) : new SimpleTimeZone(
rawOffset, id ); //$NON-NLS-1$
 
         allTimezonesList.add( tz );
         utcTimezonesMap.put( rawOffset, tz );
@@ -642,7 +642,9 @@
      */
     private void updateValueFromNonRawFields()
     {
-        Calendar calendar = Calendar.getInstance();
+        // Retain the format of the GeneralizedTime value 
+        // by only updating its calendar object.
+        Calendar calendar = value.getCalendar();
 
         // Time
         calendar.set( Calendar.HOUR_OF_DAY, hoursSpinner.getSelection() );
@@ -660,13 +662,6 @@
         {
             calendar.setTimeZone( ( TimeZone ) selection.getFirstElement() );
         }
-        else
-        {
-            calendar.setTimeZone( value.getCalendar().getTimeZone() );
-        }
-
-        // Replacing the value
-        value = new GeneralizedTime( calendar );
     }
 
 



Mime
View raw message