Permalink
Browse files

Rename date categories

  • Loading branch information...
1 parent a8841aa commit 226d4b8bc9f4af5686735e7d5dcbbbf40563cb86 @soffes soffes committed Mar 23, 2012
Showing with 30 additions and 30 deletions.
  1. +24 −24 SSToolkit/NSDate+SSToolkitAdditions.h
  2. +6 −6 SSToolkit/NSDate+SSToolkitAdditions.m
@@ -32,62 +32,62 @@
- (NSString *)ISO8601String;
-///---------------
-/// @name Time Ago
-///---------------
+///--------------------
+/// @name Time In Words
+///--------------------
/**
- Returns a string representing the time interval from now in words.
+ Returns a string representing the time interval from now in words (including seconds).
The strings produced by this method will be similar to produced by Twitter for iPhone or Tweetbot in the top right of
the tweet cells.
- Internally, this does not use `timeAgoInWordsFromTimeInterval:includingSeconds:`.
+ Internally, this does not use `timeInWordsFromTimeInterval:includingSeconds:`.
@return A string representing the time interval from now in words
*/
-- (NSString *)briefTimeAgoInWords;
+- (NSString *)briefTimeInWords;
/**
- Returns a string representing a time interval in words.
+ Returns a string representing the time interval from now in words (including seconds).
The strings produced by this method will be similar to produced by ActiveSupport's `time_ago_in_words` helper method.
- @param intervalInSeconds The time interval to convert to a string
-
- @param includeSeconds `YES` if seconds should be included. `NO` if they should not.
-
- @return A string representing the time interval in words
+ @return A string representing the time interval from now in words
- @see timeAgoInWords
- @see timeAgoInWordsIncludingSeconds:
+ @see timeInWordsIncludingSeconds:
+ @see timeInWordsFromTimeInterval:includingSeconds:
*/
-+ (NSString *)timeAgoInWordsFromTimeInterval:(NSTimeInterval)intervalInSeconds includingSeconds:(BOOL)includeSeconds;
+- (NSString *)timeInWords;
/**
- Returns a string representing the time interval from now in words (including seconds).
+ Returns a string representing the time interval from now in words.
The strings produced by this method will be similar to produced by ActiveSupport's `time_ago_in_words` helper method.
+ @param includeSeconds `YES` if seconds should be included. `NO` if they should not.
+
@return A string representing the time interval from now in words
- @see timeAgoInWordsIncludingSeconds:
- @see timeAgoInWordsFromTimeInterval:includingSeconds:
+ @see timeInWordsIncludingSeconds:
+ @see timeInWordsFromTimeInterval:includingSeconds:
*/
-- (NSString *)timeAgoInWords;
+- (NSString *)timeInWordsIncludingSeconds:(BOOL)includeSeconds;
/**
- Returns a string representing the time interval from now in words.
+ Returns a string representing a time interval in words.
The strings produced by this method will be similar to produced by ActiveSupport's `time_ago_in_words` helper method.
+ @param intervalInSeconds The time interval to convert to a string
+
@param includeSeconds `YES` if seconds should be included. `NO` if they should not.
- @return A string representing the time interval from now in words
+ @return A string representing the time interval in words
- @see timeAgoInWordsIncludingSeconds:
- @see timeAgoInWordsFromTimeInterval:includingSeconds:
+ @see timeInWords
+ @see timeInWordsIncludingSeconds:
*/
-- (NSString *)timeAgoInWordsIncludingSeconds:(BOOL)includeSeconds;
++ (NSString *)timeInWordsFromTimeInterval:(NSTimeInterval)intervalInSeconds includingSeconds:(BOOL)includeSeconds;
@end
@@ -82,7 +82,7 @@ - (NSString *)ISO8601String {
}
-- (NSString *)briefTimeAgoInWords {
+- (NSString *)briefTimeInWords {
NSTimeInterval seconds = fabs([self timeIntervalSinceNow]);
// Seconds
@@ -134,7 +134,7 @@ - (NSString *)briefTimeAgoInWords {
}
-+ (NSString *)timeAgoInWordsFromTimeInterval:(NSTimeInterval)intervalInSeconds includingSeconds:(BOOL)includeSeconds {
++ (NSString *)timeInWordsFromTimeInterval:(NSTimeInterval)intervalInSeconds includingSeconds:(BOOL)includeSeconds {
NSTimeInterval intervalInMinutes = round(intervalInSeconds / 60.0f);
if (intervalInMinutes >= 0 && intervalInMinutes <= 1) {
@@ -177,13 +177,13 @@ + (NSString *)timeAgoInWordsFromTimeInterval:(NSTimeInterval)intervalInSeconds i
}
-- (NSString *)timeAgoInWords {
- return [self timeAgoInWordsIncludingSeconds:YES];
+- (NSString *)timeInWords {
+ return [self timeInWordsIncludingSeconds:YES];
}
-- (NSString *)timeAgoInWordsIncludingSeconds:(BOOL)includeSeconds {
- return [[self class] timeAgoInWordsFromTimeInterval:fabs([self timeIntervalSinceNow]) includingSeconds:includeSeconds];
+- (NSString *)timeInWordsIncludingSeconds:(BOOL)includeSeconds {
+ return [[self class] timeInWordsFromTimeInterval:fabs([self timeIntervalSinceNow]) includingSeconds:includeSeconds];
}

0 comments on commit 226d4b8

Please sign in to comment.