Issue 39: Option to show time range for events
Status:  Released
Owner: ----
Closed:  Aug 2013
Reported by yowza...@gmail.com, Jun 16, 2009
I have hacked FC to support display of time ranges for events to satisfy my
requirements. It would be nice if this could be done via a simple option
(showTimeRange = true).  Or maybe showTime could be changed to have values
of "none", "start", "end", and "range".

The following code will display time ranges like "9:00a-10:30a" if the time
format is set to "g:ix".  I realize this code is very hacky, and I'm sure
the r2l part isn't right. But I just wanted to illustrate a solution.

function buildEventText(event, element) {
	$("<span class='event-title' />")
		.text(event.title)
		.appendTo(element);
	var st = typeof event.showTime == 'undefined' ? showTime : event.showTime;
	if (st != false) {
		if (st == true || st == 'guess' &&
			(event.start.getHours() || event.start.getMinutes() ||
			 event.end.getHours() || event.end.getMinutes())) {
				var timeStr = $.fullCalendar.formatDate(event.start, timeFormat);
				var timeEndStr = $.fullCalendar.formatDate(event.end, timeFormat);
				var timeElement = $("<span class='event-time' />");
				if (r2l) element.append(timeElement.text(' ' + timeStr + '-' +
timeEndStr));
				else element.prepend(timeElement.text(timeStr + '-' + timeEndStr + ' '));
			}
	}
}
		

Jun 28, 2009
Project Member #1 adamrs...@gmail.com
i think this is a good idea and adds flexibility, but i would make the api a little
different. i would somehow include it in the timeFormat option, so that the
programmer can use something other than the '-' if they want. maybe something like
this...

timeFormat: "g:ix-{g:ix}"

...where things in brackets enclose the end date. i'll have to think about this one a
little bit more, but can almost promise it will be in some future release. i'll
update this thread when i make more concrete plans. thanks
Status: Accepted
Jun 29, 2009
Project Member #2 adamrs...@gmail.com
(No comment was entered for this change.)
Labels: -Type-Defect Type-Enhancement
Sep 21, 2009
Project Member #3 adamrs...@gmail.com
v1.3 just released. you can now show time ranges using the 'timeFormat' option and
the *new* formatDates (http://arshaw.com/fullcalendar/docs/date-utils.php) format.
please respond to this thread if any troubles. thanks.
Status: Fixed
Nov 7, 2010
#4 maximsch...@gmail.com
I have some problems using the timeFormat to display 'H:mm{ - H:mm}'

The following is included, I use only the agenda:
timeFormat: 'H:mm{ - H:mm}',

But it still show only the start hour 'H:mm'

Browser: Safari 5.0.2
Nov 21, 2010
Project Member #5 adamrs...@gmail.com
maximschelfhout, can you post this as a new issue, and remember to include everything needed for me to recreate the bug? (html file, js files, etc...)
Nov 29, 2010
#6 ago...@gmail.com
I have the same problem.
I have configured calenda as: timeFormat: 'H:mm{ - H:mm}',

In month view I see the time correctly es. 09.30-17:30
but in the title of any event in dayBasic view I see 09:30 5:30

I see it ehit any browser
Whoat other parameters I need to change?
Thanks
Alessandro
Aug 13, 2013
Project Member #7 adamrs...@gmail.com
(No comment was entered for this change.)
Status: Implemented
Aug 13, 2013
Project Member #8 adamrs...@gmail.com
(No comment was entered for this change.)
Status: Released