capacitor-community / date-picker

Native DateTime Picker Plugin for Capacitor Apps
MIT License
87 stars 29 forks source link

Add support for `yearAndMonth` mode #88

Open oliveryasuna opened 1 week ago

oliveryasuna commented 1 week ago

iOS now supports a year/month picker natively.

if #available(iOS 17.4, *) {
    picker.datePickerMode = .yearAndMonth
} else {
    picker.datePickerMode = .date
    // Technically, iOS did support it, but it had to be set like this.
    picker.datePickerMode = .init(rawValue: 4269) ?? .date
}

if #available(iOS 13.4, *) {
    picker.preferredDatePickerStyle = .wheels
}
oliveryasuna commented 1 week ago

I opened a PR for this: https://github.com/capacitor-community/date-picker/pull/89