You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the repeating is daily count 5 from 24.06.2019 and last instance is on 28.06.2019
but the result of rule.getOccurrencesBetween return 5 occurrences from 28.06.2019
func customRuleGenerator() {
let appointentStart = "24.06.2019"
let windowStart = "28.06.2019"
let windowEnd = "28.09.2019"
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "dd.MM.yyyy"
let rule = getRule(for: dateFormatter.date(from: appointentStart)!)
let occurrences = rule.getOccurrencesBetween(beginDate: dateFormatter.date(from: windowStart)!, endDate: dateFormatter.date(from: windowEnd)!)
print(occurrences)
}
func getRule( for start: Date) -> rrule {
//frequency
let rrulefrequency: RruleFrequency = .daily
//dtstart
let rruledtstart = start
//until
let rruleuntil: Date? = nil
//count
var rrulecount: Int? = 5
//interval
var rruleinterval: Int = 1
//wkst
let rrulewkst = 1 //TODO: implement week start
//byweekday
let rrulebyweekday: [Int] = []
//byweekno
let rrulebyweekno: [Int] = []
//bymonth
let rrulebymonth: [Int] = []
//bymonthday
let rrulebymonthday: [Int] = [] // if monthly and there is no weekDays
//byyearday
let rrulebyyearday: [Int] = []
//bysetpos
let rrulebysetpos: [Int] = []
let rule = rrule(frequency: rrulefrequency, dtstart: rruledtstart, until: rruleuntil, count: rrulecount, interval: rruleinterval, wkst: rrulewkst, bysetpos: rrulebysetpos, bymonth: rrulebymonth, bymonthday: rrulebymonthday, byyearday: rrulebyyearday, byweekno: rrulebyweekno, byweekday: rrulebyweekday, byhour: [], byminute: [], bysecond: [])
return rule
}
The text was updated successfully, but these errors were encountered:
the repeating is daily count 5 from 24.06.2019 and last instance is on 28.06.2019
but the result of rule.getOccurrencesBetween return 5 occurrences from 28.06.2019
The text was updated successfully, but these errors were encountered: