Indivo Framework (iOS)
An iOS framework for Apps connecting to Indivo server
 All Classes Functions Variables Properties Pages
Instance Methods | Class Methods | Properties | List of all members
INDateRangeFormatter Class Reference

This class tries to find the best display format for a date range. More...

#import <INDateRangeFormatter.h>

Inherits UIViewController.

Instance Methods

(NSString *) - formattedRange
 Calls "formattedRangeForMaxWith:withFont:" with a width of CGFLOAT_MAX and no font. More...
 
(NSString *) - formattedRangeForLabel:
 Calls "formattedRangeForMaxWidth:withFont:" with the label's bounds and font. More...
 
(NSString *) - formattedRangeForMaxWidth:withFont:
 Formats the date range according to the given dates and tries to find the optimal format to fit into the given width. More...
 

Class Methods

(id) + rangeFormatterFrom:to:
 

Properties

NSDate * from
 The range start date, may be nil. More...
 
NSLocale * locale
 Defaults to current locale. More...
 
NSString * sinceString
 Defaults to "Since", used if no "to" date is given. More...
 
NSDate * to
 The range end date, may be nil. More...
 
NSString * untilString
 Defaults to "Until", used if no "from" date is given. More...
 

Detailed Description

This class tries to find the best display format for a date range.

Method Documentation

- (NSString *) formattedRange

Calls "formattedRangeForMaxWith:withFont:" with a width of CGFLOAT_MAX and no font.

- (NSString *) formattedRangeForLabel: (UILabel *)  aLabel

Calls "formattedRangeForMaxWidth:withFont:" with the label's bounds and font.

- (NSString *) formattedRangeForMaxWidth: (CGFloat)  maxWidth
withFont: (UIFont *)  aFont 

Formats the date range according to the given dates and tries to find the optimal format to fit into the given width.

Parameters
maxWidthThe maximum width the string should have, not guaranteed that the requirement will be met.
aFontThe font to be used to determine whether the string fits or not.
Returns
A formatted string representing the date range
+ (id) rangeFormatterFrom: (NSDate *)  fromDate
to: (NSDate *)  toDate 

Property Documentation

- (NSDate*) from
readwritenonatomicstrong

The range start date, may be nil.

- (NSLocale *) locale
readwritenonatomicstrong

Defaults to current locale.

- (NSString *) sinceString
readwritenonatomiccopy

Defaults to "Since", used if no "to" date is given.

- (NSDate*) to
readwritenonatomicstrong

The range end date, may be nil.

- (NSString *) untilString
readwritenonatomiccopy

Defaults to "Until", used if no "from" date is given.


The documentation for this class was generated from the following files: