MaterialDateTimePicker
MaterialDateTimePicker copied to clipboard
new feature - add possibility to select date and time
Add possibility to switch from date picker to time picker and back to select both date and time.
Someone proposed to create a PR for this, so it might happen soonish
Wow - that would be really awesome because I need a datetimepicker in one picker.
+1 would be great if I can select both date and time together in one dialog
please have look into this may be get some idea from this http://stackoverflow.com/a/22626706/1293313
This is in the pipeline. I'm not pinning myself down on any dates (life's been extremely busy lately), but you should see some code appear in a branch soonish.
Great - thanks for the update.
Any update on this?
Still no ETA. If you need this in the short term, you will most likely have to do it yourself.
This should work. I did it on button click event.
int yr, mon, date, hr, min, sec;
DatePickerDialog dpd = DatePickerDialog.newInstance(
new OnDateSetListener() {
@Override
public void onDateSet(DatePickerDialog view, int year, int monthOfYear, int dayOfMonth) {
yr = year;
mon = monthOfYear;
date = dayOfMonth;
TimePickerDialog tpd = TimePickerDialog.newInstance(
new OnTimeSetListener() {
@Override
public void onTimeSet(TimePickerDialog view, int hourOfDay, int minute, int second) {
hr = hourOfDay;
min = minute;
sec = second;
}
},
false
);
tpd.show(getSupportFragmentManager(), "TimePickerDialog");
}
}
);
dpd.show(getSupportFragmentManager(), "DatePickerDialog");