A date time range picker for android written in Kotlin

Overview

DateTimeRangePicker

A date time range picker for android

No start date time and no end date time Pick start date

Pick start time Have start date time and end date time

Usage

Firstly, grab latest release of the library via JitPack. And note that, it utilizes Joda-Time to process some date time logic under the hood. So you might need to set up Joda-Time properly.

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 as Long
  • endTimeInMillis as Long
  • timeZone as String

Demo

Run 2 following instrumentation tests on DateTimeRangePickerActivityTest to see the 2 usages:

  • withoutStartAndEndDateTimes()
  • withStartAndEndDateTimes()
Comments
  • time zone not come in kotlin to java

    time zone not come in kotlin to java

    Attempt to cast generated internal exception: java.lang.ClassCastException: java.util.SimpleTimeZone cannot be cast to java.lang.String

    this error is coming

    because behalf of code timezone come in string. but android studio show timezone not convert in string.

    the timezone not come because when i give timezone in intent in java class. that will not taken by kotlin class. behalf your code , u send time zone. in DateTimeRangePicker. but in java class intent working type is different. i think u know.

    how can i solve this issue. please give me a solution

    Thanks

    bug 
    opened by rajam1215 11
  • Potential data-binding version conflict

    Potential data-binding version conflict

    :DateTimeRangePicker2:compileDebugJavaWithJavac FAILED FAILURE: Build failed with an exception.

    • What went wrong: Execution failed for task ':DateTimeRangePicker2:compileDebugJavaWithJavac'.

    java.lang.annotation.IncompleteAnnotationException: android.databinding.BindingBuildInfo missing element enableDebugLogs

    I get this error when building a project using com.android.tools.build:gradle:2.3.0-beta1, this library is using a different version com.android.tools.build:gradle:2.2.3.

    opened by thuutin 4
  • Intent Error

    Intent Error

    Caused by: java.lang.IllegalStateException: intent.extras must not be null at skedgo.datetimerangepicker.DateTimeRangePickerActivity.onCreate(DateTimeRangePickerActivity.kt:47)

    This Error come When we use Intent in MainActivity java class for go in DateTimeRangePickerActivity kotlin class

    opened by rajam1215 3
  • Getting intent.extra null pointer exception

    Getting intent.extra null pointer exception

    Hi , I am creating a new project in which i have pasted your .kt file and rec , but when I define DateTimeRangePickerActivity as a LAUNCHER Activity in mainfeast and try to build project i got an error . java.lang.IllegalStateException: intent.extras must not be null. please help , I have not too much idea on Kotlin

    opened by zakirhussain49 1
  • Mocking framework

    Mocking framework

    Hi,

    hope find you well with this cold call.

    I am an author of mocking framework for Kotlin

    I see you are using mockito-kotlin.

    I just want you to be aware that there is solution that fully supports Kotlin and ask to try it in your new/current projects.

    I can help you if you answer to this issue.

    Thanks and please star it

    opened by oleksiyp 0
  • attribute isDone (aka com.example:isDone) not found

    attribute isDone (aka com.example:isDone) not found

    I have just added the dependency of this library in my build.gradle and i am getting a lot of data binding errors in dateTimeRangePicker.xml file. I have enabled data binding in my project and applied the kapt plugin.

    opened by Simarjot-sk 0
  • Databinding errors

    Databinding errors

    Steps to recreate the error

    • Install the library using the implementation 'com.github.skedgo:DateTimeRangePicker:v1.3' in build gradle.

    • Enable data binding in your project dataBinding { enabled = true } .

    • Run the app.

    • I get the following errors

    ****/ data binding error ****msg:Cannot find the setter for attribute 'app:isDone' with parameter type android.databinding.ObservableBoolean on android.support.v7.widget.Toolbar.
    file:C:\Users\username\.gradle\caches\transforms-1\files-1.1\DateTimeRangePicker-v1.3.aar\5ef60d6b1e63abe781ccc1ed1b97ba88\res\layout\date_time_range_picker.xml
    loc:27:22 - 27:44
    ****\ data binding error ****```
    opened by shivaramki 2
  • Activity not found exception

    Activity not found exception

    val intent = newIntent( this, TimeZone.getDefault(), DateTime.now().millis, DateTime.now().plusDays(2).millis ) this.startActivityForResult(intent, RQC_PICK_DATE_TIME_RANGE)

    above code gave me actvity not found error :

    android.content.ActivityNotFoundException: Unable to find explicit activity class {/skedgo.datetimerangepicker.DateTimeRangePickerActivity}; have you declared this activity in your AndroidManifest.xml?

    opened by rsd96 2
  • Error:(22) No resource identifier found for attribute 'isDone' in package 'com.myapp

    Error:(22) No resource identifier found for attribute 'isDone' in package 'com.myapp

    I have just added your project in my gradle and it throws me this error during the sync:

    C:\Users\Daniq\.android\build-
        cache\47f85a58837f42204ad53113b8b4916ad78affec\output\res\layout\date_time_range_picker.xml
        Error:(22) No resource identifier found for attribute 'isDone' in package 'com.myapp'
        Error:(39) No resource identifier found for attribute 'isVisible' in package 'com.myapp'
        Error:(52) No resource identifier found for attribute 'isVisible' in package 'com.myapp'
        Error:(98) No resource identifier found for attribute 'isVisible' in package 'com.myapp'
        Error:(111) No resource identifier found for attribute 'isVisible' in package 'com.myapp'
        Error:(28, 21) No resource type specified (at 'isDone' with value '@{viewModel.isCompletable}').
        Error:(50, 26) No resource type specified (at 'isVisible' with value '@{!viewModel.hasStartDate}').
    
    opened by SuperMasterBlasterLaser 6
Releases(v1.3)
Owner
SkedGo
SkedGo
A material Date Range Picker based on wdullaers MaterialDateTimePicker

Material Date and Time Picker with Range Selection Credits to the original amazing material date picker library by wdullaer - https://github.com/wdull

Supratim 1.3k Dec 14, 2022
Time-DatePicker - A Simple Time Date Picker With Kotlin

Time-DatePicker Time.DatePicker.mp4

Faysal Hossain 0 Jan 19, 2022
Nepali Date Picker library in Jetpack compose for android with Date conversion from BS to AD and vice-versa

Nepali Date picker Converter - Re in Compose This is a re-work of Nepali Date Picker Converter in jetpack compose and kotlin. English Locale Nepali Lo

Kiran Gyawali 4 Dec 23, 2022
Android time range picker

TimeRangePicker TimeRangePicker is a library which can be used to select a time range. WARNING Requires android-support-v4 Description This library pr

Titto Jose 422 Nov 10, 2022
A customizable, easy-to-use, and functional circular time range picker library for Android

A customizable, easy-to-use, and functional circular time range picker library for Android. Use this library to mimic Apple's iOS or Samsung's bedtime picker.

Joery Droppers 251 Dec 30, 2022
Facebook-Styled-Image-Picker - Facebook Styled Image Picker

Facebook-Styled-Image-Picker Facebook Styled Gallery Files picker. One or multip

Hashim Tahir 11 Sep 27, 2022
Pick a date or time on Android in style

Material DateTime Picker - Select a time/date in style Material DateTime Picker tries to offer you the date and time pickers as shown in the Material

null 4.7k Jan 4, 2023
A material-styled android view that provisions picking of a date, time & recurrence option, all from a single user-interface.

SublimePicker A customizable view that provisions picking of a date, time & recurrence option, all from a single user-interface. You can also view 'Su

Vikram 2.3k Jan 4, 2023
Material3 themed Jetpack Compose date & time pickers.

Compose material3 Date1 and Time pickers Highly customizable Jetpack Compose components with material3 support for date & time picking. Contents Lates

Maroš Šeleng 35 Jan 31, 2023
Standalone Android widget for picking a single date from a calendar view.

TimesSquare for Android Standalone Android widget for picking a single date from a calendar view. Usage Include CalendarPickerView in your layout XML.

Square 4.4k Dec 20, 2022
An android app that can calculate the minutes from the date the user entered, till today.

AgeInMinutesApp An android app that can calculate the minutes from the date the user entered, till today. If user tap Select Date button, Calender dia

Gurkan 0 Mar 16, 2022
[NO LONGER MAINTAINED] Android library for better Picker DialogFragments

/!\ This Project is no longer maintained /!\ DialogFragments modeled after the AOSP Clock and Calendar apps to improve UX for picking time, date, numb

Code-Troopers 2.7k Dec 29, 2022
[NO LONGER MAINTAINED] Android library for better Picker DialogFragments

/!\ This Project is no longer maintained /!\ DialogFragments modeled after the AOSP Clock and Calendar apps to improve UX for picking time, date, numb

Code-Troopers 2.7k Dec 29, 2022
Appleader707 1 Aug 9, 2022
Android Compose wheel picker library based on LazyColumn in vertical and LazyRow in horizontal.

About Android Compose wheel picker library based on LazyColumn in vertical and LazyRow in horizontal. Gradle Sample Default Item size Unfocused count

null 6 Dec 22, 2022
Alwan 🎨 is an Android Jetpack Compose color picker library.

Alwan Alwan is an Android Jetpack Compose color picker library. Preview Recording.mp4 Download Gradle: dependencies { implementation 'com.raedapps:a

Raed Mughaus 6 Sep 16, 2022
Simplge ImageGallery Picker

SimpleImagePicker add camera and files permissions to manifest file <uses-permission android:name="android.permission.CAMERA" /> <uses-permiss

null 0 Nov 27, 2021
JetCountrypicker - Country code bottomsheet picker in Jetpack Compose

JetCountryPicker Country code bottomsheet picker in Jetpack Compose How to add i

Canopas Software 30 Nov 17, 2022
A simple compose weight picker drawn with canvas.

CanvasWeightPicker A simple compose weight picker drawn with canvas. Features Drag scale to select weight Haptic feedback on weight selected Video of

Timothy Serem 5 Dec 2, 2022