Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #2 from coyotebush/no-end-time

Handle events without end times in list views
  • Loading branch information...
commit 418aec4675e9542e5051d4a93942959ca3735e27 2 parents f2606d3 + 0a76548
@thomascube thomascube authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/list/ListView.js
View
6 src/list/ListView.js
@@ -56,7 +56,7 @@ function ListEventRenderer() {
event = events[i];
// skip events out of range
- if (event.end < t.start || event.start > t.visEnd)
+ if ((event.end || event.start) < t.start || event.start > t.visEnd)
continue;
// define sections of this event
@@ -109,7 +109,7 @@ function ListEventRenderer() {
function sortCmp(a, b) {
var sd = a.start.getTime() - b.start.getTime();
- return sd + (sd ? 0 : a.end.getTime() - b.end.getTime());
+ return sd || (a.end ? a.end.getTime() : 0) - (b.end ? b.end.getTime() : 0);
}
function renderSegs(segs, modifiedEventId) {
@@ -191,7 +191,7 @@ function ListEventRenderer() {
var timeFormat = opt('timeFormat');
var dateFormat = opt('columnFormat');
var segmode = opt('listSections');
- var duration = event.end.getTime() - event.start.getTime();
+ var duration = event.end ? event.end.getTime() - event.start.getTime() : 0;
var datestr = '', timestr = '';
if (segmode == 'smart') {
Please sign in to comment.
Something went wrong with that request. Please try again.