Giter Club home page Giter Club logo

Comments (5)

JaydipRadadiya avatar JaydipRadadiya commented on May 21, 2024 5

And also you can use for range selection like this :

calendarView.setSelectionManager(new RangeSelectionManager(new OnDaySelectedListener() {

            @Override
            public void onDaySelected() {
                Log.e(" CALENDAR ", "========== setSelectionManager ==========");

                Log.e(" CALENDAR ", "Selected Dates : " + calendarView.getSelectedDates().size());
                if (calendarView.getSelectedDates().size() <= 0)
                    return;

                Log.e(" CALENDAR ", "Selected Days : " + calendarView.getSelectedDays());
                Log.e(" CALENDAR ", "Departure : DD MMM YYYY : " + formatDateToString(calendarView.getSelectedDays().get(0).getCalendar().getTime(), "dd MMM yyyy", ""));
                Log.e(" CALENDAR ", "   Return : DD MMM YYYY : " + formatDateToString(calendarView.getSelectedDays().get(calendarView.getSelectedDates().size() - 1).getCalendar().getTime(), "dd MMM yyyy", ""));

                txt_departure_date.setText(formatDateToString(calendarView.getSelectedDays().get(0).getCalendar().getTime(), "dd MMM yyyy", ""));
                txt_return_date.setText(formatDateToString(calendarView.getSelectedDays().get(calendarView.getSelectedDates().size() - 1).getCalendar().getTime(), "dd MMM yyyy", ""));

            }
        }));

from cosmocalendar.

nasreekar avatar nasreekar commented on May 21, 2024

selected date method is available.
use calendarview.getSelectedDates which gives you a list of selected dates. based on your requirement you can access the list, first/last elements for start selected date and end selected date

from cosmocalendar.

wahedzaman avatar wahedzaman commented on May 21, 2024

For me, I used it as a layout not as dialog. So, I created a new MyCalendarView which extends this CosmoCalendar and then did override @OverRide
public void onDaySelected() {} and inside this method I used my own listener. Now it works. (btw, in my layout I used MyCalendarView)

from cosmocalendar.

gsi-dennis avatar gsi-dennis commented on May 21, 2024

You can use this, so that it works for you, your class puts this implements OnDaySelectedListener, it is going to put the @OverRide method
     public void on DaySelected () {}, that's where you're going to implement what you want, and finally in the onCreate of the view you add this calendarView.setSelectionManager (new SingleSelectionManager (this));

from cosmocalendar.

tangible-idea avatar tangible-idea commented on May 21, 2024

@JaydipRadadiya
How can I change this into Kotlin?
I tried many different codes but it doesn't work.
calendar_view.selectionManager = object : RangeSelectionManager(OnDaySelectedListener { //... })

from cosmocalendar.

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.