-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Detect Empty Time Slots #19
Comments
implementing this method in MAGridView (MAWeekViewAdditions) i got the start time and end time for empty slot. - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { self.weekView=[MAWeekView new]; const double posX = _touchX.x / self.cellWidth; const double posY = _touchX.y / self.cellHeight; /* Calculate the new time for the event */ // const int eventDurationInMinutes = [self.event durationInMinutes]; NSDate *weekday = [self.weekView.weekdayBarView.weekdays objectAtIndex:(int)round(posX)]; double hours; double minutes; minutes = modf(posY, &hours) * 30; NSDateComponents *startComponents = [CURRENT_CALENDAR components:DATE_COMPONENTS fromDate:weekday]; [startComponents setHour:(int)hours]; [startComponents setMinute:[self modifiedMinutes:minutes]]; [startComponents setSecond:0]; [EventManger instance].startTime = [CURRENT_CALENDAR dateFromComponents:startComponents]; [EventManger instance].endTime = [[EventManger instance].startTime dateByAddingTimeInterval:60]; // self.event.displayDate = [CURRENT_CALENDAR dateFromComponents:startComponents]; return; [super touchesEnded:touches withEvent:event]; } |
Was trying to perform same thing, but new to ios as well. Does this solution works for you? |
Hi,
But, you need to modify
and
|
Hi,
I have a requirement that user could add events against the empty slots. Whenever user select any empty slot, its corresponding time slot should be selected as StartTime, then add the other information via custom view.
So is it possible we can detect empty slots?
Thanks & Regards
The text was updated successfully, but these errors were encountered: