i working with swift 3 for osx. i have this calendar:
this calendar should show the actual date plus 14 days. Generally it is correct, because 30 - 16 = 14 days between.
this is my code for this:
datePicker.dateValue = Calendar.current.date(byAdding: .day, value: 14, to: Date())!
but at the bottom of my calendar should be visible the days between now and the selected date. but here will be shown 13 days.
why 13 and not 14?
this text label will calculate like this:
txtDiffDays.stringValue = "(\(Calendar.current.dateComponents([.day], from: Date(), to: datePicker.dateValue).day!) Tage)"
where is my mistake?