0

I need to make a form to hold a reservation for a restaurant

To choose the reserv date, I thought it best to use a CalendarView. But not every restaurant open all days of the week. But disable only specific dates.

I tried many libraries similar to CalendarView, so you can dynamically block the specific days that fall on the day where the restaurant is closed.

So

I need a calendarview where can disable the days are Monday, Tuesdays, etc ...

Sorry about this English Google translate. Really sorry

André Dantas
  • 163
  • 1
  • 13

2 Answers2

0
i have faced the same problem using custom calendar ,
i just overridden the function of adapter 


 @Override
    public boolean isEnabled(int position) {
         if(mySet.contains(position))
            return true;
        else
            return false;
    }


then i call the function int the adapter view 

 isEnabled(position);




befoer that tale Hashset and add the position which is displaying the calanderview 

           // mysetSize=set.size();
            //isEnabled(Integer.parseInt(gridvalue));
            Log.d(dayView.getTag()+"------1-------"+gridvalue,"-------"+position);
        } else if ((Integer.parseInt(gridvalue) < 7) && (position > 28)) {
            dayView.setTextColor(Color.WHITE);
            dayView.setClickable(false);
            dayView.setFocusable(false);
            Log.d("-------mySet------","-------"+mySet);
            Log.d(mysetSize+"-------28------"+gridvalue,"-------"+position);
            set.add(position);

        } else {
            // setting curent month's days in blue color.
            dayView.setTextColor(Color.DKGRAY);
            Log.d(dayView.getTag()+"-------current display post------","-------"+position);
            mySet.add(position);
        }
Issac Balaji
  • 1,441
  • 1
  • 13
  • 25
0

Use this library ZCustomCalendar. You can set as many types of days as you want (disabled, busy, holiday).

EdmDroid
  • 1,350
  • 1
  • 11
  • 25