Date Time Range Picker for Android by android-times-square added some improvement
- Support nested scrolling
- Support vector drawable
- Small screen enhancement
- Remove out of date range exception move to nearest date instead
Standalone Android widget for picking a single date from a calendar view.
Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Add the dependency:
dependencies {
implementation "com.github.wisnukurniawan:date-time-range-picker-android:${version}"
}
Include CalendarPickerView
in your layout XML.
<com.wisnu.datetimerangepickerandroid.CalendarPickerView
android:id="@+id/calendar_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
Default implementation to show Calendar
calendar.init(today, nextYear.getTime())
.inMode(RANGE);
To show the Calendar
Calendar nextYear = Calendar.getInstance();
nextYear.add(Calendar.YEAR, 1);
CalendarPickerView calendar = (CalendarPickerView) findViewById(R.id.calendar_view);
Date today = new Date();
calendar.init(today, nextYear.getTime())
.withSelectedDate(today);
No configuration needed.