iOS - single select in Kal calendar

188 Views Asked by At

i face little problem with kal calendar library, I cant use single selection , when I select a day the next day is selected , i need single select without offset

here is the problem

enter image description here

here is the code in applicationDidFinishLaunching

//#define Single
#ifdef Single
    kal = [[KalViewController alloc] initWithSelectionMode:KalSelectionModeSingle];
    kal.selectedDate = [NSDate dateStartOfDay:[[NSDate date] offsetDay:1]];
#else
    kal = [[KalViewController alloc] initWithSelectionMode:KalSelectionModeRange];
    kal.beginDate = [NSDate dateStartOfDay:[NSDate date]];
    kal.endDate = [NSDate dateStartOfDay:[[NSDate date] offsetDay:1]];
#endif

what i have been tried

1- I set offsetDay:1 To offsetDay:0 then delete it in KalSelectionModeSingle mode but its still the same

2- comment KalSelectionModeRange mode

   //kal = [[KalViewController alloc] initWithSelectionMode:KalSelectionModeRange];
   //kal.beginDate = [NSDate dateStartOfDay:[NSDate date]];
   //kal.endDate = [NSDate dateStartOfDay:[[NSDate date] offsetDay:1]];

i get white window with no data

any help

thank you

1

There are 1 best solutions below

0
On BEST ANSWER

i figure the answer simply get my code out

//#define Single
#ifdef Single
    kal = [[KalViewController alloc] initWithSelectionMode:KalSelectionModeSingle];
    kal.selectedDate = [NSDate dateStartOfDay:[[NSDate date] offsetDay:1]];
#else
    kal = [[KalViewController alloc] initWithSelectionMode:KalSelectionModeRange];
    kal.beginDate = [NSDate dateStartOfDay:[NSDate date]];
    kal.endDate = [NSDate dateStartOfDay:[[NSDate date] offsetDay:1]];
#endif

To

 kal = [[KalViewController alloc] initWithSelectionMode:KalSelectionModeSingle];
    kal.selectedDate = [NSDate dateStartOfDay:[[NSDate date] offsetDay:1]];