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

is possible to reconfig disabled dates ? #138

Open
AdanPacheco opened this issue Sep 7, 2021 · 1 comment
Open

is possible to reconfig disabled dates ? #138

AdanPacheco opened this issue Sep 7, 2021 · 1 comment

Comments

@AdanPacheco
Copy link

No description provided.

@AdanPacheco
Copy link
Author

horizontalCalendar = new HorizontalCalendar.Builder(v, R.id.calendarView)
.range(startDate, endDate)
.datesNumberOnScreen(5)
.disableDates(new HorizontalCalendarPredicate() {
@OverRide
public boolean test(Calendar date) {
switch (date.get(Calendar.DAY_OF_WEEK)) {
case Calendar.MONDAY:
if (companies.getDaysConfig().get("MondayA") == 0) {
return true;
} else {
return false;
}
case Calendar.TUESDAY:
if (companies.getDaysConfig().get("TuesdayA") == 0) {
return true;
} else {
return false;
}
case Calendar.WEDNESDAY:
if (companies.getDaysConfig().get("WednesdayA") == 0) {
return true;
} else {
return false;
}
case Calendar.THURSDAY:
if (companies.getDaysConfig().get("ThursdayA") == 0) {
return true;
} else {
return false;
}
case Calendar.FRIDAY:
if (companies.getDaysConfig().get("FridayA") == 0) {
return true;
} else {
return false;
}
case Calendar.SATURDAY:
if (companies.getDaysConfig().get("SaturdayA") == 0) {
return true;
} else {
return false;
}
case Calendar.SUNDAY:
if (companies.getDaysConfig().get("SundayA") == 0) {
return true;
} else {
return false;
}
default:
break;
}

                    return false;
                }

                @Override
                public CalendarItemStyle style() {
                    CalendarItemStyle ca = new CalendarItemStyle();
                    ca.setColorTopText(Color.GRAY)
                            .setColorBottomText(Color.GRAY)
                            .setColorMiddleText(Color.GRAY);
                    return ca;

                }
            })
            .build();

very company has his own days configuration, so i want to reconfig the disabled dates for every company that are in the list for selection.

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

1 participant