discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fwd: NSCalendar behavior


From: Alessandro Sangiuliano
Subject: Fwd: NSCalendar behavior
Date: Sun, 1 Mar 2015 09:50:46 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.3.0

Hello, I've a different behavior of NSCalendar that makes my little App to work on OS X 10.10, 10.6.8, but not on GNUstep.

I wrote the App on 10.10, then ported on 10.6.8 to make compatible GNUstep nibs/xibs, then ported on GNUstep.

The problem seems to come from the line 59 in AppDelegate.m, when trying to calculate an NSRange:

NSRange range = [gregorian rangeOfUnit:NSDayCalendarUnit inUnit:NSMonthCalendarUnit forDate: [gregorian dateFromComponents:components]];
monthDays = range.length;
NSLog(@"Numbers of Days %ld", monthDays);

From the NSLog I can see that monthDays is "0", insted on OS X is 28 (for february, 31 for Jan, and so on). What I wrong?

You can look the code on github: https://github.com/AlessandroSangiuliano/Calendar In the OSX directory there is the OS X 10.10 version of the App.

 Best Regards,
Alex




reply via email to

[Prev in Thread] Current Thread [Next in Thread]