The datetime
module contains extensions to make date, time, and date-time picker dialogs.
dependencies {
...
implementation 'com.afollestad.material-dialogs:datetime:3.2.1'
}
MaterialDialog(this).show {
...
datePicker { dialog, date ->
// Use date (Calendar)
}
}
You can optionally provide minDate
, maxDate
and currentDate
parameters as well.
MaterialDialog(this).show {
...
timePicker { dialog, time ->
// Use time (Calendar)
}
}
You can optionally provide currentTime
and show24HoursView
parameters as well.
MaterialDialog(this).show {
...
dateTimePicker(requireFutureDateTime = true) { _, dateTime ->
// Use dateTime (Calendar)
}
}
You can optionally provide minDateTime
, maxDate
, currentDateTime
, show24HoursView
,
and requireFutureDateTime
parameters as well.