Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

40 lines (31 sloc) 0.774 kb
//
// TimeIntervalFormatter.m
// Time Tracker
//
// Created by Ivan Dramaliev on 10/18/05.
// Copyright 2005 __MyCompanyName__. All rights reserved.
//
#import "TimeIntervalFormatter.h"
@implementation TimeIntervalFormatter
+ (NSString *) secondsToString: (int) seconds
{
int hours = seconds / 3600;
int minutes = (seconds % 3600) / 60;
int secs = seconds % 60;
return [NSString stringWithFormat: @"%@%d:%@%d:%@%d",
(hours < 10 ? @"0" : @""), hours,
(minutes < 10 ? @"0" : @""), minutes,
(secs < 10 ? @"0" : @""), secs];
}
- (id)transformedValue:(id)value {
return [TimeIntervalFormatter secondsToString: [value intValue]];
}
+ (Class) transformedValueClass
{
return [NSString class];
}
+ (BOOL)allowsReverseTransformation
{
return NO;
}
@end
Jump to Line
Something went wrong with that request. Please try again.