diff --git a/SOPE/NGCards/iCalByDayMask.h b/SOPE/NGCards/iCalByDayMask.h index b094150db..b9e464887 100644 --- a/SOPE/NGCards/iCalByDayMask.h +++ b/SOPE/NGCards/iCalByDayMask.h @@ -1,8 +1,6 @@ /* iCalByDayMask.h - this file is part of SOPE * - * Copyright (C) 2010 Wolfgang Sourdeau - * - * Author: Wolfgang Sourdeau + * Copyright (C) 2010-2015 Inverse inc. * * This file is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -71,6 +69,7 @@ typedef iCalWeekOccurrence iCalWeekOccurrences[7]; - (NSString *) asRuleString; - (NSString *) asRuleStringWithIntegers; +- (NSArray *) asRuleArray; @end diff --git a/SOPE/NGCards/iCalByDayMask.m b/SOPE/NGCards/iCalByDayMask.m index 9c54e4df0..8a662666f 100644 --- a/SOPE/NGCards/iCalByDayMask.m +++ b/SOPE/NGCards/iCalByDayMask.m @@ -1,8 +1,6 @@ /* iCalByDayMask.m - this file is part of SOPE * - * Copyright (C) 2010 Inverse inc. - * - * Author: Wolfgang Sourdeau + * Copyright (C) 2010-2015 Inverse inc. * * This file is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,7 +19,9 @@ */ #import +#import #import +#import #import "iCalByDayMask.h" @@ -344,4 +344,27 @@ return s; } +- (NSArray *) asRuleArray +{ + NSMutableArray *rules; + NSMutableDictionary *rule; + int i; + + rules = [NSMutableArray array]; + for (i = 0; i < 7; i++) + { + if (days[i]) + { + rule = [NSMutableDictionary dictionary]; + if (days[i] != iCalWeekOccurrenceAll) + [rule setObject: [NSNumber numberWithInt: [self _iCalWeekOccurrenceIntValue: days[i]]] + forKey: @"occurrence"]; + [rule setObject: iCalWeekDayString[i] + forKey: @"day"]; + [rules addObject: rule]; + } + } + return rules; +} + @end /* iCalByDayMask */