简体   繁体   中英

Selecting Multiple Dates in Calendar

I am following This Blog to add a calendar component in my application. Now I want to select more than one dates to show some report for selected dates. How can I do that ?

Thanks

For this purpose in this tutorial tappedTile method is use for selection of date.so for selecting a number of dates you need to make array and add all the strings.

use like this

NSMutableArray *eventArray//your array for adding dates,make it propeerty and alloc it.

- (void)calendarView:(KLCalendarView *)calendarView tappedTile:(KLTile *)aTile{

      int month;
    month=[aTile.date monthOfYear];
    int day;
    day=[aTile.date dayOfMonth];
    int year=[aTile.date yearOfCommonEra];
    NSString *dateForCompare;

        dateForCompare=[NSString stringWithFormat:@"%i/%i/%i",month,day,year];


   [eventArray addObject:dateForCompare];
  //use this array (having dates in string format).
  // use this by using your logical capability 

}

see this link ,may be it helps you

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM