Skip to content

Commit

Permalink
If the call lasts more than 1 hour, call status shows hh:mm:ss instea…
Browse files Browse the repository at this point in the history
…d of just mm:ss.
  • Loading branch information
eofster committed Dec 16, 2008
1 parent e8aa35b commit 042497f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions AKCallController.m
Expand Up @@ -161,9 +161,15 @@ - (void)callTimerTick:(NSTimer *)theTimer
NSTimeInterval now = [NSDate timeIntervalSinceReferenceDate];
NSInteger seconds = (NSInteger)(now - [self callStartTime]);

[self setStatus:[NSString stringWithFormat:@"%02d:%02d",
(seconds / 60) % 60,
seconds % 60]];
if (seconds < 3600)
[self setStatus:[NSString stringWithFormat:@"%02d:%02d",
(seconds / 60) % 60,
seconds % 60]];
else
[self setStatus:[NSString stringWithFormat:@"%02d:%02d:%02d",
(seconds / 3600) % 24,
(seconds / 60) % 60,
seconds % 60]];
}


Expand Down

0 comments on commit 042497f

Please sign in to comment.