0

In a Mac OS X app, I try to set the datePickerMode to use rangeDataMode because I do want to pick up a range of dates (a start date & an end date).

let datePicker = NSDatePicker()
datePicker.datePickerMode = .rangeDateMode

However, the NSDatePicker still works like singleDateMode. I can only specify one date in that NSDatePicker.

How to use rangeDataMode correctly?

Joe Huang
  • 6,296
  • 7
  • 48
  • 81

1 Answers1

0

As far as I can tell, .rangeDateMode only seems to have an effect when datePickerStyle is set to .clockAndCalendarDatePickerStyle, since as you have noticed, the default "stepper" style doesn't have any obvious UI for selecting a range rather than an individual date. Try running the date picker in calendar style, and you should be able to select ranges.

Charles Srstka
  • 16,665
  • 3
  • 34
  • 60