Adium

Changeset 20756

Show
Ignore:
Timestamp:
08/24/2007 01:28:23 PM (1 year ago)
Author:
boredzo
Message:

Fixed the display of seconds only. Two of the unit tests now pass.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Frameworks/AIUtilities Framework/Source/AIDateFormatterAdditions.m

    r20752 r20756  
    201201        NSString                *timeString = nil; 
    202202        NSTimeInterval  workInterval = interval; 
    203     int                         weeks = 0, days = 0, hours = 0, minutes = 0, seconds = 0;  
     203    int                         weeks = 0, days = 0, hours = 0, minutes = 0; 
     204        NSTimeInterval  seconds = 0;  
    204205        NSString                *weeksString = nil, *daysString = nil, *hoursString = nil, *minutesString = nil, *secondsString = nil; 
    205206 
     
    227228         
    228229        //Seconds 
    229     if (workInterval) { 
    230         seconds = (int)(interval / 60); 
    231     } 
     230        seconds = workInterval; 
    232231         
    233232        //build the strings for the parts 
     
    238237                hoursString             = [NSString stringWithFormat: @"%ih",hours]; 
    239238                minutesString   = [NSString stringWithFormat: @"%im",minutes]; 
    240                 secondsString   = [NSString stringWithFormat: @"%is",seconds]; 
     239                secondsString   = [NSString stringWithFormat: @"%.0fs",seconds]; 
    241240        } else { 
    242241                weeksString             = (weeks == 1)          ? ONE_WEEK              : [NSString stringWithFormat:MULTIPLE_WEEKS, weeks];