Disable past dates on tapku

82 views Asked by At

Is there any way to disable the past dates or the desired dates in tapku calendar? Where in tapku, pressing the date occurs? I could not find it. Is it possible to set the minimum date, like in the datepicker?

1

There are 1 answers

0
Srinivasa Reddy On

I have also faced problem like this so here i managed with below code

(void)calendarMonthView:(TKCalendarMonthView *)monthView didSelectDate:(NSDate *)selectedDate
        {
         if([selectedDate compare:[NSDate date]] == NSOrderedAscending)
            {
                NSString *today=[NSString stringWithFormat:@"%@",[NSDate date]];
                NSString *chooseday=[NSString stringWithFormat:@"%@",selectedDate];
                NSArray *date1=[today componentsSeparatedByString:@" "];
                NSArray *date2=[chooseday componentsSeparatedByString:@" "];

                if([[date1 objectAtIndex:0] isEqualToString:[date2 objectAtIndex:0]])
                {
                    NSLog(@"Today date clicked");
                }
                else
                {

                    NSLog(@"Past date clicked");
                }
        }
        }