I have a date picker, and I want to limit the date picker to show the day and date and month, but the month can't be changed, it's attached to the date. i.e. Friday, January 15. January 15 is one component. It should show the current day plus the next 6 days, so one week. I don't want the year.
let gregorian: NSCalendar = NSCalendar(calendarIdentifier: NSCalendarIdentifierGregorian)!
let currentDate: NSDate = NSDate()
let components: NSDateComponents = NSDateComponents()
let minDate: NSDate = gregorian.dateByAddingComponents(components, toDate: currentDate, options: NSCalendarOptions(rawValue: 0))!
components.year = +7
let maxDate: NSDate = gregorian.dateByAddingComponents(components, toDate: currentDate, options: NSCalendarOptions(rawValue: 0))!
self.datepicker.minimumDate = minDate
self.datepicker.maximumDate = maxDate
UIDatePicker
. You need to useUIPickerView
. – rmaddy