I need to get 3 weeks with dates ahead from current date. and add all dates to an array. How I can get this?
let date = NSDate()
let calendar = NSCalendar(calendarIdentifier: NSCalendarIdentifierGregorian)
let comps = calendar?.components([.Day, .WeekOfMonth, .Month], fromDate: date)
let days = calendar?.rangeOfUnit(NSCalendarUnit.Day, inUnit: NSCalendarUnit.Month, forDate: date)
print(days?.length)
This code gives me days in current month. But 3 weaks ahead could take next month
for example today is 16.02 I need print something like this
16 17 18 19 20 21 22 23 24 25 26 27 28 29 01 02 04....
thanks for advance