Skip to content

Commit

Permalink
Ensure the range includes the entire time span of the event.
Browse files Browse the repository at this point in the history
Fixes issues when moving a mulitday event with resources partially
outside the currently viewed timespan.
  • Loading branch information
mrubinsk committed Aug 31, 2014
1 parent 6846f18 commit 916a077
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions kronolith/js/kronolith.js
Original file line number Diff line number Diff line change
Expand Up @@ -5531,7 +5531,9 @@ KronolithCore = {
event = events.find(function(e) { return e.key == eventid; });
}
if (!dt) {
dt = new Date(event.value.s).toString('yyyyMMdd');
dt = new Date(event.value.s);
} else {
dt = this.parseDate(dt);
}
if (event) {
$H(event.value.rs).each(function(r) {
Expand Down Expand Up @@ -5567,7 +5569,15 @@ KronolithCore = {
}.bind(this));

if (update_cals.length) {
dates = this.viewDates(this.parseDate(dt), this.view);
dates = this.viewDates(dt, this.view);
// Ensure we also grab the full length of the events.
if (dates[0].isAfter(dt)) {
dates[0] = dt;
}
var dt_end = new Date(event.value.e);
if (dt_end.isAfter(dates[1])) {
dates[1] = dt_end;
}
this.loadEvents(dates[0], dates[1], this.view, update_cals);
}
}
Expand Down

0 comments on commit 916a077

Please sign in to comment.