Giter Site home page Giter Site logo

Comments (7)

J-Jamet avatar J-Jamet commented on May 17, 2024 1

You're right, there's a bug with the years. The setter is used by style attributes in

<com.kunzisoft.switchdatetime.date.widget.ListPickerYearView
            xmlns:year="http://schemas.android.com/apk/res-auto"
            android:id="@+id/yearPicker"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            year:minYear="1900"
            year:maxYear="3000"
            year:defaultYear="2016"
            />

And setter can't be changed because of

setMinYear(yearTypedArray.getInt(R.styleable.ListPickerYearView_minYear, minYear));
setMaxYear(yearTypedArray.getInt(R.styleable.ListPickerYearView_maxYear, minYear));

I will change the code so that the setters have priority over the XML. I will also change the listView by a recycleView because I have found delays.
I will try to upload the new version in the day.

from android-switchdatetimepicker.

J-Jamet avatar J-Jamet commented on May 17, 2024 1

You can do this now with 1.4 version, but you can't precise a time for restriction.
And you can now set a default DateTime with
dateTimeFragment.setDefaultDateTime(new GregorianCalendar(2017, Calendar.MARCH, 4, 15, 20).getTime());

from android-switchdatetimepicker.

J-Jamet avatar J-Jamet commented on May 17, 2024

Hi !
You can add code in the project, the problem will be to manage the time lock on the different views and to synchronize them.You must add gray parts to the views, prevent the cursor from each view from going over those gray areas. And manage the listeners so that the time is compatible with the day of the month of the year, that the day is compatible with the month of the year, etc ...
It's a lot of work and if you want to contribute it will be very appreciated. :) For the moment, I add features of the other posts.

from android-switchdatetimepicker.

arunsekaran02 avatar arunsekaran02 commented on May 17, 2024

materialCalendarView.state().edit().setMinimumDate(CalendarDay.from(2016, 12, 31)).commit();
above line helps to disable past dates.
https://github.com/prolificinteractive/material-calendarview

i tried following line to limit year.But its not working programmatically.
listPickerYearView.setMinYear(2017);

from android-switchdatetimepicker.

J-Jamet avatar J-Jamet commented on May 17, 2024

OK, It's working in my PC but I must change few bugs before commit. You will be able to set a minimum and maximum dates but I have not yet manage hours and minutes.

from android-switchdatetimepicker.

arunsekaran02 avatar arunsekaran02 commented on May 17, 2024

Thank you @J-Jamet

from android-switchdatetimepicker.

J-Jamet avatar J-Jamet commented on May 17, 2024

Link #33

from android-switchdatetimepicker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.