Glow-Inc / GLCalendarView

A fully customizable calendar view acting as a date range picker
MIT License
855 stars 106 forks source link

Set maximum days for range #19

Closed skuske closed 8 years ago

skuske commented 8 years ago

Is there any way to set a maximum of days for a range, i.e. can dragging a range be limited to a specific maximum like 7 days only? Thanks.

ltebean commented 8 years ago

You can achieve it by return NO in this delegate method

- (BOOL)calenderView:(GLCalendarView *)calendarView canUpdateRange:(GLCalendarDateRange *)range toBeginDate:(NSDate *)beginDate endDate:(NSDate *)endDate
{
    // check against the limit, if exceeds, return NO
    return YES;
}