A date time range picker for android
With start and end date times specified:
val intent = DateTimeRangePickerActivity.newIntent(
context,
TimeZone.getDefault(),
DateTime.now().millis,
DateTime.now().plusDays(2).millis
)
activity.startActivityForResult(intent, RQC_PICK_DATE_TIME_RANGE)
Or without start and end date times:
val intent = DateTimeRangePickerActivity.newIntent(
context,
TimeZone.getDefault(),
null, null
)
activity.startActivityForResult(intent, RQC_PICK_DATE_TIME_RANGE)
At onActivityResult()
, DateTimeRangePickerActivity
will return an Intent
data having following:
startTimeInMillis
asLong
endTimeInMillis
asLong
timeZone
asString
Run 2 following instrumentation tests on DateTimeRangePickerActivityTest
to see the 2 usages:
showDateTimeRangePickerWithoutStartAndEndDateTimes()
showDateTimeRangePickerWithStartAndEndDateTimes()