fulberto100
fulberto100

Reputation: 313

how to get selected date from Kal control?

1- i want to get selected date from Kal control. (https://github.com/klazuka/Kal)

i added the codes to my controller:

kal = [[KalViewController alloc] init];
kal.delegate = self;
navController = [[UINavigationController alloc] initWithRootViewController:kal];

In which event can i read the selected date?

2- i don't want to show bottom tableview, is it possible?

i just need calendar view.

Upvotes: 0

Views: 1302

Answers (2)

ethemsulan
ethemsulan

Reputation: 2299

NSLog(@"Selected date: %@",to);

Upvotes: 0

Źirk Kelevra
Źirk Kelevra

Reputation: 300

in KalViewController.m search for the following function:

-(void)didSelectDate:(KalDate *)date
{
self.selectedDate = [date NSDate];
NSDate *from = [[date NSDate] cc_dateByMovingToBeginningOfDay];
NSDate *to = [[date NSDate] cc_dateByMovingToEndOfDay];
[self clearTable];
[dataSource loadItemsFromDate:from toDate:to];
[tableView reloadData];
[tableView flashScrollIndicators];
}

running NSLog(@"%@",[date NSDate]); in didSelectDate from KalViewController.m returned the date selected from the kal calendar.

OUTPUT:

2011-11-23 14:51:00.345 xx[23467:207] 2011-11-27 08:00:00 +0000
2011-11-23 14:51:01.234 xx[23467:207] 2011-11-28 08:00:00 +0000
2011-11-23 14:51:01.728 xx[23467:207] 2011-11-27 08:00:00 +0000

Upvotes: 2

Related Questions