Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can I change the starting week to Sunday? #89

Open
Ken-Kang opened this issue Nov 19, 2020 · 1 comment
Open

Can I change the starting week to Sunday? #89

Ken-Kang opened this issue Nov 19, 2020 · 1 comment

Comments

@Ken-Kang
Copy link

Can I change the starting week to Sunday?

and Is there a way to know which date I chose when I chose the date?

@abdulrahmankazi
Copy link

abdulrahmankazi commented May 27, 2021

  1. Can I change the starting week to Sunday?

Yes you can
calendarView.setFirstDayOfWeek(Calendar.SUNDAY);

  1. Is there a way to know which date I chose when I chose the date?

Yes

    calendarView.setSelectionManager(new SingleSelectionManager(new OnDaySelectedListener() {
        @Override
        public void onDaySelected() {

            Date selectedDate = calendarView.getSelectedDays().get(0).getCalendar().getTime();
            SimpleDateFormat format = new SimpleDateFormat("EEE MM-dd-yyyy");
            try {
                String nowAsString = format.format(selectedDate);
                Date parsedDate = format.parse(nowAsString);
                clickedDate = format.format(parsedDate);
               }catch(Exception e){
                 }  
              }
    }));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants