4

I have implemented calendar view in iPhone using Kal library. The source code is here https://github.com/klazuka/Kal. I want disable the previous dates. Only the today date and the future date must be clickable.

halfer
  • 19,824
  • 17
  • 99
  • 186
Warrior
  • 39,156
  • 44
  • 139
  • 214
  • Disable means, user interaction shouldn't want there? – Tirth Jul 15 '13 at 05:43
  • @iAmbitious: Yes, i don't want user interaction. – Warrior Jul 15 '13 at 06:07
  • From the official close reasons: _Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself_. – halfer Nov 03 '17 at 21:03

1 Answers1

5

Go to KalGridView.m & replace -(void)setSelectedTile:(KalTileView *)tile with code given below.

- (void)setSelectedTile:(KalTileView *)tile
{
    if (selectedTile != tile && [[KalDate dateFromNSDate:[NSDate date]] compare:tile.date] != NSOrderedDescending) 
    {
        selectedTile.selected = NO;
        selectedTile = [tile retain];
        tile.selected = YES;
        [delegate didSelectDate:tile.date];
    }
}

And now all those dates prior to current date will be disabled.

alloc_iNit
  • 5,173
  • 2
  • 26
  • 54