Il 01/03/2015 14:53, Stefan Bidigaray ha scritto:

I'm on the road and not in front of a computer, so there's little I can do. However, I can say the code in NSCalendar is very dependent on ICU. Can you please provide some information on the version of GNUstep and ICU you are using? How did you install GNUstep? From source or package? Also, please verify that GNUstep is linked against ICU with the ldd command.

The ldd output on libgnustep-base of libicu (it is the 4.8.1 version):

libicui18n.so.48 => /usr/lib/x86_64-linux-gnu/libicui18n.so.48 (0x00007f3d6b22c000) libicuuc.so.48 => /usr/lib/x86_64-linux-gnu/libicuuc.so.48 (0x00007f3d6b0ba000) libicudata.so.48 => /usr/lib/x86_64-linux-gnu/libicudata.so.48 (0x00007f3d69f49000)

I never installed gnustep from pckages, I ever build it from the svn and the last time I updated it was 4 days ago.


So -base is at 1.24.7 and gui is at 0.24

On Mar 1, 2015 8:47 AM, "Alessandro Sangiuliano" <[email protected] <mailto:[email protected]>> wrote:

    Il 01/03/2015 12:58, Alessandro Sangiuliano ha scritto:

        Il 01/03/2015 11:06, Riccardo Mottola ha scritto:

            Hi,

            Alessandro Sangiuliano wrote:

                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?

            Have you checked out the components? e.g. is "gregorian"
            valid? components?

            Can you split this code up in a small example that can be
            run from the command line? so I can compare how it works
            on 10.6 and 10.4 for example and see if it works on
            GNUstep, debug, etc etc.

            Riccardo

            _______________________________________________
            Discuss-gnustep mailing list
            [email protected] <mailto:[email protected]>
            https://lists.gnu.org/mailman/listinfo/discuss-gnustep



        Ok, when I'll have the time I'll write a little tool to test:

        1) NSCalendar initialization
        2) NSDateComponents creation from NSCalendar
        3) Some other things similar to the previous
        4) If you have requests, add them...

        In the while I added this code to that method:

        - (void)
        setMonthDaysMonthAndYearFromComponents:(NSDateComponents*)components
        {
                [monthLabel setStringValue:[monthSymbols
        objectAtIndex:[components month] - 1]];
                [yearLabel setStringValue:[NSString
        stringWithFormat:@"%ld", [components year]]];
                NSLog(@"Components verification:\nday %ld\nmonth
        %ld\nyear %ld.\n Calendar verification %@", [components day],
        [components month], [components year], [gregorian description]);
                                     NSDate *tmp = [gregorian
        dateFromComponents:components];
                                     NSLog(@"Date from components
        verification: %@", [tmp description]);
                NSRange range = [gregorian
        rangeOfUnit:NSDayCalendarUnit inUnit:NSMonthCalendarUnit
        forDate:[gregorian dateFromComponents:components]];
                monthDays = range.length;
                NSLog(@"Numbers of Days %ld", monthDays);
                                     monthDays = 31;
        }

        All the NSLog are printing the correct output, so it is all valid.

        Also, the xcodeproj file on gitub, in the Calendar root
        directory was generated by Xcode 3.2.2 from OS X 10.6.8

        Alex.

        _______________________________________________
        Discuss-gnustep mailing list
        [email protected] <mailto:[email protected]>
        https://lists.gnu.org/mailman/listinfo/discuss-gnustep


    I have to do an errata corrige.
    I said that NSLogs are printing the correct output, and it is true
    for all NSLog except for:

            NSLog(@"Numbers of Days %ld", monthDays);
            monthDays = 31;

    That NSLog prints the value of monthDays that is "0" for some
    reason (It should be 31, now that is March). Please, also, ignore
    the line

            monthDays = 31

    It was just for test and I forgot to delete it before sending the
    email.

    Best regards,
    Alex


    _______________________________________________
    Discuss-gnustep mailing list
    [email protected] <mailto:[email protected]>
    https://lists.gnu.org/mailman/listinfo/discuss-gnustep


Alex.
_______________________________________________
Discuss-gnustep mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep

Reply via email to