-------- Original Message --------
Subject: [ 100854 ] NSCalendarDate bug
Date: Sat, 04 May 2002 23:46:23 -0400
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]

Support Request #100854, was updated on 2002-May-04 23:46
You can respond by visiting:
http://savannah.gnu.org/support/?func=detailsupport&support_id=100854&group_id=99

Category: Foundation
Status: Open
Priority: 5
Summary: NSCalendarDate bug

By: lcampbel
Date: 2002-May-04 23:46

Message:
Logged In: NO
Browser: Mozilla/4.5 (compatible; OmniWeb/4.1-v391; Mac_PowerPC)

-[NSCalendarDate initWithString:calendarFormat:] supplies elements of 
the current date/time for any components that are missing from the 
format string. For example, if you omit the %S, it supplies the current 
seconds.

This is clearly wrong:

1. It means that parsing the same string with the same format can give 
different answers -- 60 different answers, for example, if the %S is 
missing.

2. It is not the way MacOS X behaves. MacOS X supplies the origin value 
(0 for seconds, 1 for month, etc) for missing items.

Here's the fix:

==== 
//projects/shared/gnustep-base-1.1.0/akamai/gnustep-base/Source/NSCalendarDate.m#1 
- 
/common/u0/lcampbel/build/358/akamai/gnustep-base/Source/NSCalendarDate.m 
====
@@ -892,31 +892,6 @@
           had |= hadD;
         }

-      /*
-       * Use current date/time information for anything missing.
-       */
-      if ((had & (hadY|hadM|hadD|hadh|hadm|hads))
-       != (hadY|hadM|hadD|hadh|hadm|hads))
-       {
-         NSCalendarDate        *now = [NSCalendarDate  date];
-         int                   Y, M, D, h, m, s;
-
-         [now setTimeZone: tz];
-         [now getYear: &Y month: &M day: &D hour: &h minute: &m second: 
&s];
-         if ((had & hadY) == 0)
-           year = Y;
-         if ((had & hadM) == 0)
-           month = M;
-         if ((had & hadD) == 0)
-           day = D;
-         if ((had & hadh) == 0)
-           hour = h;
-         if ((had & hadm) == 0)
-           min = m;
-         if ((had & hads) == 0)
-           sec = s;
-       }
-
        return [self initWithYear: year
                           month: month
                             day: day


----------------------------------------------------------------------
You can respond by visiting:
http://savannah.gnu.org/support/?func=detailsupport&support_id=100854&group_id=99

-- 
Adam Fedor, Digital Optics Corp.      | I'm glad I hate spinach, because
http://www.doc.com                    | if I didn't, I'd eat it, and you
                                       | know how I hate the stuff.


_______________________________________________
Bug-gnustep mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-gnustep

Reply via email to