CosmoCalendar icon indicating copy to clipboard operation
CosmoCalendar copied to clipboard

Can I change the starting week to Sunday?

Open Ken-Kang opened this issue 5 years ago • 1 comments

Can I change the starting week to Sunday?

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

Ken-Kang avatar Nov 19 '20 06:11 Ken-Kang

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

abdulrahmankazi avatar May 27 '21 13:05 abdulrahmankazi