#import <JSQMessagesTimestampFormatter.h>
An instance of JSQMessagesTimestampFormatter is a singleton object that provides an efficient means for creating attributed and non-attributed string representations of NSDate objects. It is intended to be used as the method by which you display timestamps in a JSQMessagesCollectionView.
| - (NSAttributedString *) attributedTimestampForDate: |
|
(NSDate *) |
date |
|
Returns an attributed string representation of the given date formatted as described in timestampForDate:. It applies the attributes in dateTextAttributes and timeTextAttributes, respectively.
- Parameters
-
- Returns
- A formatted, attributed string representation of date.
- See also
- timestampForDate:.
-
dateTextAttributes.
-
timeTextAttributes.
| - (NSString *) relativeDateForDate: |
|
(NSDate *) |
date |
|
Returns a string representation of only the day, month, and year components of the given date formatted in the current locale styled using NSDateFormatterMediumStyle.
- Parameters
-
- Returns
- A formatted string representation of the day, month, and year components of date.
Returns the shared timestamp formatter object.
- Returns
- The shared timestamp formatter object.
| - (NSString *) timeForDate: |
|
(NSDate *) |
date |
|
Returns a string representation of only the minute and hour components of the given date formatted in the current locale styled using NSDateFormatterShortStyle.
- Parameters
-
- Returns
- A formatted string representation of the minute and hour components of date.
| - (NSString *) timestampForDate: |
|
(NSDate *) |
date |
|
Returns a string representation of the given date formatted in the current locale using NSDateFormatterMediumStyle for the date style and NSDateFormatterShortStyle for the time style. It uses relative date formatting where possible.
- Parameters
-
- Returns
- A formatted string representation of date.
| - (NSDateFormatter*) dateFormatter |
|
readnonatomicstrong |
| - (NSDictionary*) dateTextAttributes |
|
readwritenonatomiccopy |
The text attributes to apply to the day, month, and year components of the string representation of a given date. The default value is a dictionary containing attributes that specify centered, light gray text and the bold system font at size 12.0f.
| - (NSDictionary*) timeTextAttributes |
|
readwritenonatomiccopy |
The text attributes to apply to the minute and hour componenents of the string representation of a given date. The default value is a dictionary containing attributes that specify centered, light gray text and the system font at size 12.0f.
The documentation for this class was generated from the following files: