Closed flaviusdemian closed 7 years ago
Hey @slown1,
DatePickerDialog has a datePicker: UIDatePicker
, so you can select the 24H mode by doing the following:
let dialog = DatePickerDialog()
dialog.datePicker.datePickerMode = UIDatePickerMode.time
dialog.datePicker.locale = NSLocale(localeIdentifier: "en_GB") as Locale // using Great Britain for this example
dialog.show(title: "DatePickerDialog", doneButtonTitle: "Done", cancelButtonTitle: "Cancel", minimumDate: threeMonthAgo, maximumDate: currentDate, datePickerMode: .dateAndTime) { (date) in
if let dt = date {
self.textField.text = "\(dt)"
}
}
Let me know if you need additional help 👍
Thankyou so much...its working
Hello, In my project i need up to 99 hours time format.how to change 24 hours to 99 hours..Can you help me
@kavin06 unfortunately you won't be able to do that since UIDatePicker doesn't support that
Hello,
Can you please point out how to enable 24H format instead of using AM and PM for the time?
Thank you.