squimer / DatePickerDialog-iOS-Swift

Date picker dialog for iOS
MIT License
581 stars 177 forks source link

how to add default time for making DatePickerDialog as time picker #74

Closed TheikChan closed 6 years ago

TheikChan commented 6 years ago

i can't add default time for using DatePickerDialog as time picker

thank you

lfarah commented 6 years ago

You can do it by setting a defaultDate on the initializer:

        datePicker.show("DatePickerDialog",
                        doneButtonTitle: "Done",
                        cancelButtonTitle: "Cancel",
                        defaultDate: currentDate,
                        minimumDate: threeMonthAgo,
                        maximumDate: Date(),
                        datePickerMode: .date) { (date) in

Closing this. Please reopen if you need any help

TheikChan commented 6 years ago

thank you so much