Changeset 6233


Ignore:
Timestamp:
Jun 19, 2008, 8:53:08 PM (14 years ago)
Author:
livings124
Message:

when setting up the speed limit timer, create the fire date using the user's default calendar

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r6232 r6233  
    23462346        return;
    23472347   
    2348     NSCalendar * calendar = [[NSCalendar alloc] initWithCalendarIdentifier: NSGregorianCalendar];
     2348    NSCalendar * calendar = [NSCalendar currentCalendar];
    23492349    NSDateComponents * nowComponents = [calendar components: NSHourCalendarUnit | NSMinuteCalendarUnit fromDate: [NSDate date]],
    23502350                    * onComponents = [calendar components: NSHourCalendarUnit | NSMinuteCalendarUnit
     
    23522352                    * offComponents = [calendar components: NSHourCalendarUnit | NSMinuteCalendarUnit
    23532353                                        fromDate: [fDefaults objectForKey: @"SpeedLimitAutoOffDate"]];
    2354     [calendar release];
    23552354   
    23562355    //check if should be on if within range
     
    24002399   
    24012400    //create date with combination of the current date and the date to go off
    2402     NSCalendar * calendar = [[NSCalendar alloc] initWithCalendarIdentifier: NSGregorianCalendar];
     2401    NSCalendar * calendar = [NSCalendar currentCalendar];
    24032402    NSDateComponents * nowComponents = [calendar components: NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit
    24042403                                        | NSHourCalendarUnit | NSMinuteCalendarUnit fromDate: [NSDate date]],
     
    24162415   
    24172416    NSDate * dateToUse = [calendar dateFromComponents: nowComponents];
    2418     [calendar release];
    24192417   
    24202418    fSpeedLimitTimer = [[NSTimer alloc] initWithFireDate: dateToUse interval: 0 target: self selector: @selector(autoSpeedLimit:)
Note: See TracChangeset for help on using the changeset viewer.