Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var matchingComponents = DateComponents()
- matchingComponents.day = 5
- let nextDate = Calendar.current.nextDate(after: Date(), matching: matchingComponents, matchingPolicy: .nextTime, repeatedTimePolicy: .first, direction: .forward)
- var matching2 = DateComponents.init(calendar: Calendar.current, timeZone: TimeZone.current, era: 1, year: nil, month: nil, day: 5, hour: nil, minute: nil, second: nil, nanosecond: nil, weekday: nil, weekdayOrdinal: nil, quarter: nil, weekOfMonth: nil, weekOfYear: nil, yearForWeekOfYear: nil)
- let nextDate = Calendar.current.nextDate(after: Date(), matching: matching2, matchingPolicy: Calendar.MatchingPolicy.nextTime, repeatedTimePolicy:.first, direction:.forward)
Add Comment
Please, Sign In to add comment