Skip to content

Commit

Permalink
Merge branch 'feature/fix-exdate-bug'
Browse files Browse the repository at this point in the history
  • Loading branch information
bruce committed Jan 5, 2018
2 parents 280b217 + a82cd3f commit 141beab
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Sources/ExclusionDate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,15 @@ public struct ExclusionDate {
self.component = component
}

public func toExDateString() -> String {
public func toExDateString() -> String? {
var exdateString = "EXDATE:"
let dateStrings = dates.map { (date) -> String in
return RRule.dateFormatter.string(from: date)
}
if dateStrings.count > 0 {
exdateString += dateStrings.joined(separator: ",")
} else {
return nil
}

if String(exdateString.suffix(from: exdateString.characters.index(exdateString.endIndex, offsetBy: -1))) == "," {
Expand Down

0 comments on commit 141beab

Please sign in to comment.