Changeset 551 for trunk/Cocoa/Pester/Source/PSAlarm.m
- Timestamp:
- 07/18/09 05:59:22 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cocoa/Pester/Source/PSAlarm.m
r366 r551 328 328 - (NSString *)intervalString; 329 329 { 330 const unsigned long long mval = 99 , minute = 60, hour = minute * 60;330 const unsigned long long mval = 999, minute = 60, hour = minute * 60, day = hour * 24, week = day * 7; 331 331 unsigned long long interval = [self interval]; 332 332 if (interval == 0) return nil; 333 333 334 if (interval == 1) return @"One second"; 334 335 if (interval == minute) return @"One minute"; 336 if (interval == hour) return @"One hour"; 337 if (interval == day) return @"One day"; 338 if (interval == week) return @"One week"; 339 340 if (interval % week == 0) return [NSString stringWithFormat: @"%u weeks", (unsigned)(interval / week)]; 341 if (interval % day == 0) return [NSString stringWithFormat: @"%u days", (unsigned)(interval / day)]; 342 if (interval % hour == 0) return [NSString stringWithFormat: @"%u hours", (unsigned)(interval / hour)]; 335 343 if (interval % minute == 0) return [NSString stringWithFormat: @"%u minutes", (unsigned)(interval / minute)]; 344 336 345 if (interval <= mval) return [NSString stringWithFormat: @"%u seconds", (unsigned)interval]; 337 if (interval == hour) return @"One hour";338 if (interval % hour == 0) return [NSString stringWithFormat: @"%u hours", (unsigned)(interval / hour)];339 346 if (interval <= mval * minute) return [NSString stringWithFormat: @"%u minutes", (unsigned)(interval / minute)]; 340 347 if (interval <= mval * hour) return [NSString stringWithFormat: @"%u hours", (unsigned)(interval / hour)]; 348 if (interval <= mval * day) return [NSString stringWithFormat: @"%u days", (unsigned)(interval / day)]; 349 return [NSString stringWithFormat: @"%u weeks", (unsigned)(interval / week)]; 350 341 351 return [self _stringForInterval: interval]; 342 352 }
Note:
See TracChangeset
for help on using the changeset viewer.