ZendriveShiftTime
@interface ZendriveShiftTime : NSObject
Represents a particular day and time in a weekly schedule. The shift time is represented in 24 hour time format.
-
Represents the day of the week, range: [1-7]
Declaration
Objective-C
@property (nonatomic) ZendriveDayOfWeek dayOfWeek;
-
Represents the hour of the day. range: [0-23].
Declaration
Objective-C
@property (nonatomic) NSInteger hour;
-
Represents the minute of the hour. range: [0-59].
Declaration
Objective-C
@property (nonatomic) NSInteger minute;
-
Initializes the ZendriveShiftTime object. Example
ZendriveShiftTime *startTime = [[ZendriveShiftTime alloc initWithDayOfWeek:2 hour:11 minute:30];
Declaration
Objective-C
- (nonnull id)initWithDayOfWeek:(ZendriveDayOfWeek)dayOfWeek hour:(NSInteger)hour minute:(NSInteger)minute;
-
Initializes the ZendriveShiftTime object with NSDictionary.. Example
NSDictionary *shiftTimeDictionary = { @"day_of_week": @"Sunday", @"hour": 11, @"minute": 30 } ZendriveShiftTime *startTime = [[ZendriveShiftTime alloc initWithDictionary:shiftTimeDictionary];
Declaration
Objective-C
- (nonnull id)initWithDictionary:(nonnull NSDictionary *)dictionary;
-
Initializes the ZendriveShiftTime object with NSDate. Example
ZendriveShiftTime *startTime = [[ZendriveShiftTime alloc initWithDate:[[NSDate alloc] init]];
Declaration
Objective-C
- (nonnull id)initWithDate:(nonnull NSDate *)date timeZone:(nonnull NSTimeZone *)timezone;
-
Converts the the ZendriveShiftTime to dictionary. Example:
{ @"day_of_week": @"Sunday", @"hour": 11, @"minute": 30 }
Declaration
Objective-C
- (nonnull NSDictionary *)toDictionary;
-
Converts the String to ZendriveDayOfWeekEnum.
Declaration
Objective-C
+ (ZendriveDayOfWeek)stringToDayOfWeek:(nonnull NSString *)dayOfWeekString;
-
Converts the ZendriveDayOfWeekEnum to String.
Declaration
Objective-C
+ (nonnull NSString *)getStringFromDayOfWeek:(ZendriveDayOfWeek)dayOfWeek;
-
Primarily used to compare two shift time objects having consecutive days, Example ZendriveShiftTime(Sunday 11,0) is less than ZendriveShiftTime(Sunday, 14,0) ZendriveShiftTime(Sunday 11,0) is less than ZendriveShiftTime(Monday, 14,0) ZendriveShiftTime(Sunday 11,0) is less than ZendriveShiftTime(Sunday, 11,1) ZendriveShiftTime(Sunday 11,0) is greater than ZendriveShiftTime(Sunday, 10,0) ZendriveShiftTime(Sunday 11,0) is greater than ZendriveShiftTime(Saturday, 14,0). (In a weekly schedule, the next day following Saturday is Sunday.)
Declaration
Objective-C
- (NSComparisonResult)compare:(nonnull id)object;