wisnukurniawan/date-time-range-picker-android


Standalone Android widget for picking a single date, multiple date, and range of date from a calendar view.

Download


Step 1. Add the JitPack repository to your build file

Add it in your root build.gradle at the end of repositories:

	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url 'https://jitpack.io' }
		}
	}
	<repositories>
		<repository>
		    <id>jitpack.io</id>
		    <url>https://jitpack.io</url>
		</repository>
	</repositories>

Add it in your build.sbt at the end of resolvers:

 
    resolvers += "jitpack" at "https://jitpack.io"
        
    

Add it in your project.clj at the end of repositories:

 
    :repositories [["jitpack" "https://jitpack.io"]]
        
    

Step 2. Add the dependency

	dependencies {
		implementation 'com.github.wisnukurniawan:date-time-range-picker-android:1.0.10'
	}
	<dependency>
	    <groupId>com.github.wisnukurniawan</groupId>
	    <artifactId>date-time-range-picker-android</artifactId>
	    <version>1.0.10</version>
	</dependency>

                            
    libraryDependencies += "com.github.wisnukurniawan" % "date-time-range-picker-android" % "1.0.10"
        
        

                            
    :dependencies [[com.github.wisnukurniawan/date-time-range-picker-android "1.0.10"]]
        
        

Readme


Date Time Range Picker for Android by android-times-square added some improvement

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.

<img src="https://github.com/wisnukurniawan/date-time-range-picker-android/blob/master/screenshot.png" width="300" height="533" />

Installation

Via Gradle

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}"
}

Usage


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);

Proguard

No configuration needed.