0

I have implemented android Caldroid library to my project.

and already get selected dates

I

I tried

caldroidFragment.setSelectedDates(fromDate, toDate);

but, it does not let me get range of selected dates, and demo does not show how to get range

I also use, which is object but not a String,

caldroidFragment.getCaldroidData().get(caldroidFragment.SELECTED_DATES);

So, anyone have any idea, how to get selected dates ranges in number?

Jay Kominek
  • 8,674
  • 1
  • 34
  • 51
Axay Prajapati
  • 791
  • 5
  • 20

1 Answers1

0

Actually, I got another way to get exactly days between fromDate and toDate,

The formula is

String getNoDays = String.format("%d", 
        TimeUnit.MILLISECONDS.toDays(Math.abs(fromDate.getTime() - toDate.getTime())));

Hope it will be helpful to others as well.

Andrew T.
  • 4,701
  • 8
  • 43
  • 62
Axay Prajapati
  • 791
  • 5
  • 20