| Issue 39: | Option to show time range for events | |
| 2 people starred this issue and may be notified of changes. | Back to list |
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 29, 2009
(No comment was entered for this change.)
Labels:
-Type-Defect Type-Enhancement
Sep 21, 2009
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
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
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
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
(No comment was entered for this change.)
Status:
Implemented
Aug 13, 2013
(No comment was entered for this change.)
Status:
Released
|
|
| ► Sign in to add a comment |
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