Disable previous dates in kalkaldare on iPhone

I used the calendar on the iPhone using the Kal library. The source code is here https://github.com/klazuka/Kal . I want to disable previous dates. Only today's date and future date should be available for viewing.

+4
source share
1 answer

Go to KalGridView.m and replace - (void) setSelectedTile: (KalTileView *) tile with the code 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 these dates until the current date will be disabled.

+5
source

Source: https://habr.com/ru/post/1491367/


All Articles