Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NSCalendar rangeOfUnit:inUnit:forDate: not implemented #1

Open
AlessandroSangiuliano opened this issue Feb 28, 2015 · 1 comment
Open
Labels
bug Use this tag for reporting bugs or issues that impede the software's normal functionality.

Comments

@AlessandroSangiuliano
Copy link

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 version of the App.

Best Regards,

Alex.

P.S: I sent this mail two times on the discuXX-gnustXX mailing list, one yesterday and one this morning, but seems my mails are no more accepted by the server for some reason.

@stefanbidi
Copy link
Member

The answer to this is quite simple, the method you are using is unimplemented. I believe it would be possible to implement this method using ICU's ucal_getLimit(). Would you be able to write some test cases this method?

@hmelder hmelder added the bug Use this tag for reporting bugs or issues that impede the software's normal functionality. label Sep 9, 2023
@hmelder hmelder changed the title NSCalendar behavior [NSCalendar] rangeOfUnit:inUnit:forDate: not implemented Sep 9, 2023
@hmelder hmelder changed the title [NSCalendar] rangeOfUnit:inUnit:forDate: not implemented NSCalendar rangeOfUnit:inUnit:forDate: not implemented Sep 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Use this tag for reporting bugs or issues that impede the software's normal functionality.
Development

No branches or pull requests

3 participants