My favorites | Sign in
Project Home Issues
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 196: Method for scrolling to a time (for agenda views)
14 people starred this issue and may be notified of changes. Back to list
Status:  ExportedToGithub
Owner:  ----
Closed:  Aug 2015


Sign in to add a comment
 
Reported by lfran...@gmail.com, Nov 18, 2009
Is there any way to go to a particular time in the agenda view once the
calendar has been initialized?
Nov 27, 2009
Project Member #1 adamrs...@gmail.com
will the `firstHour` option do it for you?
(http://arshaw.com/fullcalendar/docs/index.php#basic-options)
Nov 27, 2009
#2 lfran...@gmail.com
It would do the trick if it worked once the calendar has been initialized... I can't 
get it to work programmatically
Nov 27, 2009
Project Member #3 adamrs...@gmail.com
got it. you can't currently do this w/ gotoDate, but it would be a good feature to
have. will be in an upcoming release.
Summary: time in gotoDate method (for agenda views)
Status: Accepted
Labels: -Type-Defect -Priority-Medium Type-Enhancement
Jan 20, 2010
#4 sneed...@gmail.com
i was able to put something together that might need a little tweaking as I'm still
testing it myself (adam might be able to tie it in better). 

in the viewMethods object I added:
scrollToHour: function (hour) {
	var self = this;
	var scrollable = this.element.find(".fc-agenda-body");
	var slot = hour;
	
	var target = this.element.find(".fc-agenda-body .fc-axis:even:eq(" + slot + ")");
	if(target.length){
		scrollable.animate({scrollTop: 0}, 0, function() {
		var targetOffset = target.offset().top;
		var scroll = targetOffset - scrollable.offset().top - target.outerHeight();
		scrollable.animate({scrollTop: scroll}, 500);
	});
			 }
}

i tied it in by putting a call in each view 'render' method to automatically scroll
on render 

i.e.

views.basicDay = function(element, options) {
	return new Grid(element, options, {
		render: function(date, delta, height, fetchEvents) {
			if (delta) {
				addDays(date, delta);
				if (!options.weekends) {
					skipWeekend(date, delta < 0 ? -1 : 1);
				}
			}
			this.title = formatDate(date, this.option('titleFormat'), options);
			this.start = this.visStart = cloneDate(date, true);
			this.end = this.visEnd = addDays(cloneDate(this.start), 1);
			this.renderGrid(1, 1, this.option('columnFormat'), false, height, fetchEvents);
			this.scrollToHour(date.getHours());
		}
	});
}
Jan 10, 2012
#5 russell....@gmail.com
Would you be able to put the full js file here, so we can see how you did it.
Aug 13, 2013
Project Member #6 adamrs...@gmail.com
(No comment was entered for this change.)
Summary: Scroll to time with gotoDate method (for agenda views) (was: time in gotoDate method (for agenda views))
Labels: -Type-Enhancement Type-Feature
Aug 13, 2013
Project Member #7 adamrs...@gmail.com
could be with `gotoDate`, which accepts a date AND time

or maybe 'scrollToTime`, which only accepts a time
Summary: Method for scrolling to a time (for agenda views) (was: Scroll to time with gotoDate method (for agenda views))
Aug 13, 2013
Project Member #8 adamrs...@gmail.com
 Issue 626  has been merged into this issue.
Jun 5, 2014
Project Member #9 adamrs...@gmail.com
Here is a implementation by @jtmanteo:
https://github.com/arshaw/fullcalendar/pull/90

I have not tested it nor investigated its compatibility with v2, but worth checking out.
Nov 17, 2014
#10 war...@gmail.com
i simply hacked fullcaledar adding and id for each timeslice span then used jQuery scrollTo plugin. 
Aug 21, 2015
Project Member #11 adamrs...@gmail.com
Discussion for this issue has moved to the following URL:
https://github.com/fullcalendar/fullcalendar/issues/467

This is because Google Code is shutting down. Apologies if you are being pestered with these notifications. This is a one-time event.

Happy coding,
Adam
Status: ExportedToGithub
Sign in to add a comment

Powered by Google Project Hosting