ESRangeToDatesConverter Class Reference
Inherits from | NSObject |
Declared in | ESRangeToDatesConverter.h ESRangeToDatesConverter.mm |
Overview
A class to convert the NSRange a pair of NSDate ofjects. It can be useful to build timeline selection GUI components.
It supports the following resolutions
- day
- week
- month
- quarter
- half year
- year
Note : The dates must be aligned to a given resolution
Instance Methods
getEndDate
A date for the end of the range.
- (NSDate *)getEndDate
Discussion
result = globalBegin + ( timelineRange.location + timelineRange.length ) * resolution
Declared In
ESRangeToDatesConverter.h
getStartDate
A date for the beginning of the range.
- (NSDate *)getStartDate
Discussion
result = globalBegin + timelineRange.location * resolution
Declared In
ESRangeToDatesConverter.h
initWithTimelineStartDate:timelineEndDate:resolution:locale:
A designated initializer. Note : dates must be aligned to a given resolution
- (instancetype)initWithTimelineStartDate:(NSDate *)globalBegin_ timelineEndDate:(NSDate *)globalEnd_ resolution:(ESDateResolution)resolution_ locale:(NSLocale *)locale_
Parameters
- globalBegin_
The beginning of a timeline range.
- globalEnd_
The end of a timeline range.
- resolution_
Resolution to scale dates against.
- locale_
The locale for calendar computations. Note : It will have the highest impact on week calculations.
Return Value
A properly initialized ESDatesToRangeConverter object.
Declared In
ESRangeToDatesConverter.h