The datetime
module contains extensions to make date, time, and date-time picker dialogs.
dependencies {
...
implementation 'com.afollestad.material-dialogs:datetime:3.0.0-rc1'
}
MaterialDialog(this).show {
...
datePicker { dialog, date ->
// Use date (Calendar)
}
}
You can optionally provide minDate
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
, currentDateTime
, show24HoursView
,
and requireFutureDateTime
parameters as well.