ActionSheetPicker-3.0
ActionSheetPicker-3.0 copied to clipboard
ActionSheetDatePicker return not correct Date (-1 day)
ActionSheetDatePicker return not correct Date (-1 day) My code:
let picker = ActionSheetDatePicker.show(withTitle: title, datePickerMode: .date, selectedDate: value ?? maximumDate ?? Date(), minimumDate: minimumDate, maximumDate: maximumDate, doneBlock: {
[weak self] _, date, origin in
// !!! ----- RETURN DATE -1 DAY -----
if let date = date as? Date {
self?.value = date
completed(date)
} else {
completed(nil)
}
}, cancel: {
_ in
completed(nil)
}, origin: origin)
self.picker = nil
if let picker = picker {
self.picker = picker
} else {
completed(nil)
}
Why that happens an how to fix that?
+1
Same here. Is there an any solution? If I convert to string than display correct.
@MehulSojitra16 / @SashaLexor / @ChristianDeckert do you guys still face this issue on the latest version?
+1
As I remember it happens when picker doesnt stop completley and you press done. It's standart behaviour of native picker, so we can't change it in the library.