abhi-dave / ADDatePicker

A fully customizable iOS Horizontal PickerView library, written in pure swift
MIT License
170 stars 25 forks source link

App crash on 31 March #13

Open sameer4 opened 5 years ago

sameer4 commented 5 years ago

From debugging..it seems days model does't contain 31 so

let d = days.index { (modelObj) -> Bool in return Int(modelObj.type) == Int(dd) }

gives nil and crashes on days[d!].isSelected = true

sameer4 commented 5 years ago

issue is in use of dummy data "2006" for years and "06" for months when there is no ModelDate is in selected state, they returns 30 days and if initialDate is date with 31 day...app crashes

sameer4 commented 5 years ago

just changed var currentMonth = "6" to var currentMonth = "7" so Library can have 31 days as default

refundr commented 4 years ago

my app (picker) just crashed for this same bug on March 31st, 2020 for release 1.0.0 - did this get released? Thanks for your help !