فهرست منبع

use view dateProfile prop

Adam Shaw 8 سال پیش
والد
کامیت
343820c368

+ 1 - 1
src/Calendar.render.js

@@ -275,7 +275,7 @@ Calendar.mixin({
 		if (
 			!this.ignoreWindowResize &&
 			ev.target === window && // so we don't process jqui "resize" events that have bubbled up
-			this.view.renderUnzonedRange // view has already been rendered
+			this.view.isDatesRendered
 		) {
 			if (this.updateSize(true)) {
 				this.publiclyTrigger('windowResize', [ this.view ]);

+ 1 - 1
src/Calendar.toolbar.js

@@ -68,7 +68,7 @@ Calendar.mixin({
 		var nextInfo = view.buildNextDateProfile(this.currentDate);
 
 		this.toolbarsManager.proxyCall(
-			(todayInfo.isValid && !view.currentUnzonedRange.containsDate(now)) ?
+			(todayInfo.isValid && !view.get('dateProfile').currentUnzonedRange.containsDate(now)) ?
 				'enableButton' :
 				'disableButton',
 			'today'

+ 33 - 53
src/View.date-range.js

@@ -1,29 +1,6 @@
 
 View.mixin({
 
-	// range the view is formally responsible for.
-	// for example, a month view might have 1st-31st, excluding padded dates
-	currentUnzonedRange: null,
-	currentRangeUnit: null, // name of largest unit being displayed, like "month" or "week"
-
-	isRangeAllDay: false,
-
-	// date range with a rendered skeleton
-	// includes not-active days that need some sort of DOM
-	renderUnzonedRange: null,
-
-	// dates that display events and accept drag-n-drop
-	activeUnzonedRange: null,
-
-	// constraint for where prev/next operations can go and where events can be dragged/resized to.
-	// an object with optional start and end properties.
-	validUnzonedRange: null,
-
-	// how far the current date will move for a prev/next operation
-	dateIncrement: null,
-
-	minTime: null, // Duration object that denotes the first visible time of any given day
-	maxTime: null, // Duration object that denotes the exclusive visible end time of any given day
 	usesMinMaxTime: false, // whether minTime/maxTime will affect the activeUnzonedRange. Views must opt-in.
 
 	// DEPRECATED
@@ -37,33 +14,11 @@ View.mixin({
 	------------------------------------------------------------------------------------------------------------------*/
 
 
-	setDateProfileForRendering: function(dateProfile) {
-		var calendar = this.calendar;
-
-		this.currentUnzonedRange = dateProfile.currentUnzonedRange;
-		this.currentRangeUnit = dateProfile.currentRangeUnit;
-		this.isRangeAllDay = dateProfile.isRangeAllDay;
-		this.renderUnzonedRange = dateProfile.renderUnzonedRange;
-		this.activeUnzonedRange = dateProfile.activeUnzonedRange;
-		this.validUnzonedRange = dateProfile.validUnzonedRange;
-		this.dateIncrement = dateProfile.dateIncrement;
-		this.minTime = dateProfile.minTime;
-		this.maxTime = dateProfile.maxTime;
-
-		// DEPRECATED, but we need to keep it updated...
-		this.start = calendar.msToMoment(dateProfile.activeUnzonedRange.startMs, this.isRangeAllDay);
-		this.end = calendar.msToMoment(dateProfile.activeUnzonedRange.endMs, this.isRangeAllDay);
-		this.intervalStart = calendar.msToMoment(dateProfile.currentUnzonedRange.startMs, this.isRangeAllDay);
-		this.intervalEnd = calendar.msToMoment(dateProfile.currentUnzonedRange.endMs, this.isRangeAllDay);
-
-		this.title = this.computeTitle();
-		this.calendar.reportViewDatesChanged(this, dateProfile);
-	},
-
-
 	// Builds a structure with info about what the dates/ranges will be for the "prev" view.
 	buildPrevDateProfile: function(date) {
-		var prevDate = date.clone().startOf(this.currentRangeUnit).subtract(this.dateIncrement);
+		var dateProfile = this.get('dateProfile');
+		var prevDate = date.clone().startOf(dateProfile.currentRangeUnit)
+			.subtract(dateProfile.dateIncrement);
 
 		return this.buildDateProfile(prevDate, -1);
 	},
@@ -71,7 +26,9 @@ View.mixin({
 
 	// Builds a structure with info about what the dates/ranges will be for the "next" view.
 	buildNextDateProfile: function(date) {
-		var nextDate = date.clone().startOf(this.currentRangeUnit).add(this.dateIncrement);
+		var dateProfile = this.get('dateProfile');
+		var nextDate = date.clone().startOf(dateProfile.currentRangeUnit)
+			.add(dateProfile.dateIncrement);
 
 		return this.buildDateProfile(nextDate, 1);
 	},
@@ -86,6 +43,7 @@ View.mixin({
 		var minTime = null;
 		var maxTime = null;
 		var currentInfo;
+		var isRangeAllDay;
 		var renderUnzonedRange;
 		var activeUnzonedRange;
 		var isValid;
@@ -98,7 +56,8 @@ View.mixin({
 		}
 
 		currentInfo = this.buildCurrentRangeInfo(date, direction);
-		renderUnzonedRange = this.buildRenderRange(currentInfo.unzonedRange, currentInfo.unit);
+		isRangeAllDay = /^(year|month|week|day)$/.test(currentInfo.unit);
+		renderUnzonedRange = this.buildRenderRange(currentInfo.unzonedRange, currentInfo.unit, isRangeAllDay);
 		activeUnzonedRange = renderUnzonedRange.clone();
 
 		if (!this.opt('showNonCurrentDates')) {
@@ -123,16 +82,37 @@ View.mixin({
 		isValid = currentInfo.unzonedRange.intersectsWith(validUnzonedRange);
 
 		return {
+			// constraint for where prev/next operations can go and where events can be dragged/resized to.
+			// an object with optional start and end properties.
 			validUnzonedRange: validUnzonedRange,
+
+			// range the view is formally responsible for.
+			// for example, a month view might have 1st-31st, excluding padded dates
 			currentUnzonedRange: currentInfo.unzonedRange,
+
+			// name of largest unit being displayed, like "month" or "week"
 			currentRangeUnit: currentInfo.unit,
-			isRangeAllDay: /^(year|month|week|day)$/.test(currentInfo.unit),
+
+			isRangeAllDay: isRangeAllDay,
+
+			// dates that display events and accept drag-n-drop
 			activeUnzonedRange: activeUnzonedRange,
+
+			// date range with a rendered skeleton
+			// includes not-active days that need some sort of DOM
 			renderUnzonedRange: renderUnzonedRange,
+
+			// Duration object that denotes the first visible time of any given day
 			minTime: minTime,
+
+			// Duration object that denotes the exclusive visible end time of any given day
 			maxTime: maxTime,
+
 			isValid: isValid,
+
 			date: date,
+
+			// how far the current date will move for a prev/next operation
 			dateIncrement: this.buildDateIncrement(currentInfo.duration)
 				// pass a fallback (might be null) ^
 		};
@@ -297,7 +277,7 @@ View.mixin({
 
 	// Computes the range that will represent the element/cells for *rendering*,
 	// but which may have voided days/times.
-	buildRenderRange: function(currentUnzonedRange, currentRangeUnit) {
+	buildRenderRange: function(currentUnzonedRange, currentRangeUnit, isRangeAllDay) {
 		// cut off days in the currentUnzonedRange that are hidden
 		return this.trimHiddenDays(currentUnzonedRange);
 	},
@@ -339,7 +319,7 @@ View.mixin({
 	// Compute the number of the give units in the "current" range.
 	// Will return a floating-point number. Won't round.
 	currentRangeAs: function(unit) {
-		var currentUnzonedRange = this.currentUnzonedRange;
+		var currentUnzonedRange = this.get('dateProfile').currentUnzonedRange;
 
 		return moment.utc(currentUnzonedRange.endMs).diff(
 			moment.utc(currentUnzonedRange.startMs),

+ 26 - 10
src/View.js

@@ -126,22 +126,23 @@ var View = FC.View = InteractiveDateComponent.extend({
 
 	// Computes what the title at the top of the calendar should be for this view
 	computeTitle: function() {
+		var dateProfile = this.get('dateProfile');
 		var unzonedRange;
 
 		// for views that span a large unit of time, show the proper interval, ignoring stray days before and after
-		if (/^(year|month)$/.test(this.currentRangeUnit)) {
-			unzonedRange = this.currentUnzonedRange;
+		if (/^(year|month)$/.test(dateProfile.currentRangeUnit)) {
+			unzonedRange = dateProfile.currentUnzonedRange;
 		}
 		else { // for day units or smaller, use the actual day range
-			unzonedRange = this.activeUnzonedRange;
+			unzonedRange = dateProfile.activeUnzonedRange;
 		}
 
 		return this.formatRange(
 			{
-				start: this.calendar.msToMoment(unzonedRange.startMs, this.isRangeAllDay),
-				end: this.calendar.msToMoment(unzonedRange.endMs, this.isRangeAllDay)
+				start: this.calendar.msToMoment(unzonedRange.startMs, dateProfile.isRangeAllDay),
+				end: this.calendar.msToMoment(unzonedRange.endMs, dateProfile.isRangeAllDay)
 			},
-			this.isRangeAllDay,
+			dateProfile.isRangeAllDay,
 			this.opt('titleFormat') || this.computeTitleFormat(),
 			this.opt('titleRangeSeparator')
 		);
@@ -151,10 +152,12 @@ var View = FC.View = InteractiveDateComponent.extend({
 	// Generates the format string that should be used to generate the title for the current date range.
 	// Attempts to compute the most appropriate format if not explicitly specified with `titleFormat`.
 	computeTitleFormat: function() {
-		if (this.currentRangeUnit == 'year') {
+		var currentRangeUnit = this.get('dateProfile').currentRangeUnit;
+
+		if (currentRangeUnit == 'year') {
 			return 'YYYY';
 		}
-		else if (this.currentRangeUnit == 'month') {
+		else if (currentRangeUnit == 'month') {
 			return this.opt('monthYearFormat'); // like "September 2014"
 		}
 		else if (this.currentRangeAs('days') > 1) {
@@ -339,8 +342,6 @@ var View = FC.View = InteractiveDateComponent.extend({
 	// if dateProfile not specified, uses current
 	executeDateRender: function(dateProfile, skipScroll) {
 
-		this.setDateProfileForRendering(dateProfile);
-
 		if (this.render) {
 			this.render(); // TODO: deprecate
 		}
@@ -1068,6 +1069,21 @@ var View = FC.View = InteractiveDateComponent.extend({
 });
 
 
+View.watch('dateProfileMisc', [ 'dateProfile' ], function(deps) {
+	var calendar = this.calendar;
+	var dateProfile = deps.dateProfile;
+
+	// DEPRECATED, but we need to keep it updated...
+	this.start = calendar.msToMoment(dateProfile.activeUnzonedRange.startMs, dateProfile.isRangeAllDay);
+	this.end = calendar.msToMoment(dateProfile.activeUnzonedRange.endMs, dateProfile.isRangeAllDay);
+	this.intervalStart = calendar.msToMoment(dateProfile.currentUnzonedRange.startMs, dateProfile.isRangeAllDay);
+	this.intervalEnd = calendar.msToMoment(dateProfile.currentUnzonedRange.endMs, dateProfile.isRangeAllDay);
+
+	this.title = this.computeTitle();
+	this.calendar.reportViewDatesChanged(this, dateProfile);
+});
+
+
 View.watch('displayingDates', [ 'dateProfile' ], function(deps) {
 	this.requestDateRender(deps.dateProfile);
 }, function() {

+ 2 - 1
src/agenda/AgendaView.js

@@ -371,7 +371,8 @@ var agendaTimeGridMethods = {
 	// Generates the HTML that will go before the day-of week header cells
 	renderHeadIntroHtml: function() {
 		var view = this.view;
-		var weekStart = view.calendar.msToUtcMoment(view.renderUnzonedRange.startMs, true);
+		var dateProfile = view.get('dateProfile');
+		var weekStart = view.calendar.msToUtcMoment(dateProfile.renderUnzonedRange.startMs, true);
 		var weekText;
 
 		if (this.opt('weekNumbers')) {

+ 10 - 8
src/agenda/TimeGrid.js

@@ -75,7 +75,7 @@ var TimeGrid = FC.TimeGrid = InteractiveDateComponent.extend(StandardInteraction
 
 
 	rangeUpdated: function() {
-		var view = this.view;
+		var dateProfile = this.view.get('dateProfile');
 
 		this.updateDayTable();
 
@@ -85,8 +85,8 @@ var TimeGrid = FC.TimeGrid = InteractiveDateComponent.extend(StandardInteraction
 
 		this.dayRanges = this.dayDates.map(function(dayDate) {
 			return new UnzonedRange(
-				dayDate.clone().add(view.minTime),
-				dayDate.clone().add(view.maxTime)
+				dayDate.clone().add(dateProfile.minTime),
+				dayDate.clone().add(dateProfile.maxTime)
 			);
 		});
 	},
@@ -223,16 +223,17 @@ var TimeGrid = FC.TimeGrid = InteractiveDateComponent.extend(StandardInteraction
 		var calendar = view.calendar;
 		var theme = calendar.theme;
 		var isRTL = this.isRTL;
+		var dateProfile = view.get('dateProfile');
 		var html = '';
-		var slotTime = moment.duration(+view.minTime); // wish there was .clone() for durations
+		var slotTime = moment.duration(+dateProfile.minTime); // wish there was .clone() for durations
 		var slotIterator = moment.duration(0);
 		var slotDate; // will be on the view's first day, but we only care about its time
 		var isLabeled;
 		var axisHtml;
 
 		// Calculate the time for each slot
-		while (slotTime < view.maxTime) {
-			slotDate = calendar.msToUtcMoment(view.renderUnzonedRange.startMs).time(slotTime);
+		while (slotTime < dateProfile.maxTime) {
+			slotDate = calendar.msToUtcMoment(dateProfile.renderUnzonedRange.startMs).time(slotTime);
 			isLabeled = isInt(divideDurationByDuration(slotIterator, this.labelInterval));
 
 			axisHtml =
@@ -422,7 +423,8 @@ var TimeGrid = FC.TimeGrid = InteractiveDateComponent.extend(StandardInteraction
 	// Computes the top coordinate, relative to the bounds of the grid, of the given time (a Duration).
 	computeTimeTop: function(time) {
 		var len = this.slatEls.length;
-		var slatCoverage = (time - this.view.minTime) / this.slotDuration; // floating-point value of # of slots covered
+		var dateProfile = this.view.get('dateProfile');
+		var slatCoverage = (time - dateProfile.minTime) / this.slotDuration; // floating-point value of # of slots covered
 		var slatIndex;
 		var slatRemainder;
 
@@ -555,7 +557,7 @@ var TimeGrid = FC.TimeGrid = InteractiveDateComponent.extend(StandardInteraction
 
 	// Given a row number of the grid, representing a "snap", returns a time (Duration) from its start-of-day
 	computeSnapTime: function(snapIndex) {
-		return moment.duration(this.view.minTime + this.snapDuration * snapIndex);
+		return moment.duration(this.view.get('dateProfile').minTime + this.snapDuration * snapIndex);
 	},
 
 

+ 5 - 4
src/basic/BasicView.js

@@ -45,10 +45,10 @@ var BasicView = FC.BasicView = View.extend({
 
 
 	// Computes the date range that will be rendered.
-	buildRenderRange: function(currentUnzonedRange, currentRangeUnit) {
+	buildRenderRange: function(currentUnzonedRange, currentRangeUnit, isRangeAllDay) {
 		var renderUnzonedRange = View.prototype.buildRenderRange.apply(this, arguments); // an UnzonedRange
-		var start = this.calendar.msToUtcMoment(renderUnzonedRange.startMs, this.isRangeAllDay);
-		var end = this.calendar.msToUtcMoment(renderUnzonedRange.endMs, this.isRangeAllDay);
+		var start = this.calendar.msToUtcMoment(renderUnzonedRange.startMs, isRangeAllDay);
+		var end = this.calendar.msToUtcMoment(renderUnzonedRange.endMs, isRangeAllDay);
 
 		// year and month views should be aligned with weeks. this is already done for week
 		if (/^(year|month)$/.test(currentRangeUnit)) {
@@ -66,8 +66,9 @@ var BasicView = FC.BasicView = View.extend({
 
 	// Renders the view into `this.el`, which should already be assigned
 	renderDates: function() {
+		var dateProfile = this.get('dateProfile');
 
-		this.dayGrid.breakOnWeeks = /year|month|week/.test(this.currentRangeUnit); // do before Grid::setRange
+		this.dayGrid.breakOnWeeks = /year|month|week/.test(dateProfile.currentRangeUnit);
 		this.dayGrid.rangeUpdated();
 
 		this.dayNumbersVisible = this.dayGrid.rowCnt > 1; // TODO: make grid responsible

+ 1 - 1
src/basic/DayGrid.js

@@ -185,7 +185,7 @@ var DayGrid = FC.DayGrid = InteractiveDateComponent.extend(StandardInteractionsM
 	renderNumberCellHtml: function(date) {
 		var view = this.view;
 		var html = '';
-		var isDateValid = view.activeUnzonedRange.containsDate(date); // TODO: called too frequently. cache somehow.
+		var isDateValid = view.get('dateProfile').activeUnzonedRange.containsDate(date); // TODO: called too frequently. cache somehow.
 		var isDayNumberVisible = view.dayNumbersVisible && isDateValid;
 		var classes;
 		var weekCalcFirstDoW;

+ 6 - 4
src/basic/MonthView.js

@@ -6,10 +6,10 @@ var MonthView = FC.MonthView = BasicView.extend({
 
 
 	// Computes the date range that will be rendered.
-	buildRenderRange: function() {
+	buildRenderRange: function(currentUnzonedRange, currentRangeUnit, isRangeAllDay) {
 		var renderUnzonedRange = BasicView.prototype.buildRenderRange.apply(this, arguments);
-		var start = this.calendar.msToUtcMoment(renderUnzonedRange.startMs, this.isRangeAllDay);
-		var end = this.calendar.msToUtcMoment(renderUnzonedRange.endMs, this.isRangeAllDay);
+		var start = this.calendar.msToUtcMoment(renderUnzonedRange.startMs, isRangeAllDay);
+		var end = this.calendar.msToUtcMoment(renderUnzonedRange.endMs, isRangeAllDay);
 		var rowCnt;
 
 		// ensure 6 weeks
@@ -42,7 +42,9 @@ var MonthView = FC.MonthView = BasicView.extend({
 
 
 	isDateInOtherMonth: function(date) {
-		return date.month() !== moment.utc(this.currentUnzonedRange.startMs).month(); // TODO: optimize
+		var dateProfile = this.get('dateProfile');
+
+		return date.month() !== moment.utc(dateProfile.currentUnzonedRange.startMs).month(); // TODO: optimize
 	}
 
 });

+ 2 - 2
src/component/DateComponent.js

@@ -150,7 +150,7 @@ var DateComponent = Component.extend({
 
 		for (id in eventsPayload) {
 			eventInstanceGroup = eventsPayload[id];
-			eventRenderRanges = eventInstanceGroup.sliceRenderRanges(view.activeUnzonedRange);
+			eventRenderRanges = eventInstanceGroup.sliceRenderRanges(view.get('dateProfile').activeUnzonedRange);
 			eventFootprints = this.eventRangesToEventFootprints(eventRenderRanges);
 
 			if (eventInstanceGroup.getEventDef().hasBgRendering()) {
@@ -384,7 +384,7 @@ var DateComponent = Component.extend({
 		var view = this._getView();
 		var footprint = this.getHitFootprint(hit);
 
-		if (!view.activeUnzonedRange.containsRange(footprint.unzonedRange)) {
+		if (!view.get('dateProfile').activeUnzonedRange.containsRange(footprint.unzonedRange)) {
 			return null;
 		}
 

+ 1 - 1
src/component/DateComponent.util.js

@@ -59,7 +59,7 @@ DateComponent.mixin({
 		var classes = [];
 		var today;
 
-		if (!view.activeUnzonedRange.containsDate(date)) {
+		if (!view.get('dateProfile').activeUnzonedRange.containsDate(date)) {
 			classes.push('fc-disabled-day'); // TODO: jQuery UI theme?
 		}
 		else {

+ 5 - 4
src/component/DayTableMixin.js

@@ -18,8 +18,9 @@ var DayTableMixin = FC.DayTableMixin = {
 	updateDayTable: function() {
 		var view = this.view;
 		var calendar = view.calendar;
-		var date = calendar.msToUtcMoment(view.renderUnzonedRange.startMs, true);
-		var end = calendar.msToUtcMoment(view.renderUnzonedRange.endMs, true);
+		var dateProfile = view.get('dateProfile');
+		var date = calendar.msToUtcMoment(dateProfile.renderUnzonedRange.startMs, true);
+		var end = calendar.msToUtcMoment(dateProfile.renderUnzonedRange.endMs, true);
 		var dayIndex = -1;
 		var dayIndices = [];
 		var dayDates = [];
@@ -296,7 +297,7 @@ var DayTableMixin = FC.DayTableMixin = {
 	// (colspan should be no different)
 	renderHeadDateCellHtml: function(date, colspan, otherAttrs) {
 		var view = this.view;
-		var isDateValid = view.activeUnzonedRange.containsDate(date); // TODO: called too frequently. cache somehow.
+		var isDateValid = view.get('dateProfile').activeUnzonedRange.containsDate(date); // TODO: called too frequently. cache somehow.
 		var classNames = [
 			'fc-day-header',
 			view.calendar.theme.getClass('widgetHeader')
@@ -374,7 +375,7 @@ var DayTableMixin = FC.DayTableMixin = {
 
 	renderBgCellHtml: function(date, otherAttrs) {
 		var view = this.view;
-		var isDateValid = view.activeUnzonedRange.containsDate(date); // TODO: called too frequently. cache somehow.
+		var isDateValid = view.get('dateProfile').activeUnzonedRange.containsDate(date); // TODO: called too frequently. cache somehow.
 		var classes = this.getDayClasses(date);
 
 		classes.unshift('fc-day', view.calendar.theme.getClass('widgetContent'));

+ 4 - 2
src/component/InteractiveDateComponent.js

@@ -295,12 +295,13 @@ var InteractiveDateComponent = DateComponent.extend({
 	// NOTE: very similar to isExternalInstanceGroupAllowed
 	isEventInstanceGroupAllowed: function(eventInstanceGroup) {
 		var view = this._getView();
+		var dateProfile = view.get('dateProfile');
 		var eventFootprints = this.eventRangesToEventFootprints(eventInstanceGroup.getAllEventRanges());
 		var i;
 
 		for (i = 0; i < eventFootprints.length; i++) {
 			// TODO: just use getAllEventRanges directly
-			if (!view.validUnzonedRange.containsRange(eventFootprints[i].componentFootprint.unzonedRange)) {
+			if (!dateProfile.validUnzonedRange.containsRange(eventFootprints[i].componentFootprint.unzonedRange)) {
 				return false;
 			}
 		}
@@ -313,11 +314,12 @@ var InteractiveDateComponent = DateComponent.extend({
 	// when it's a completely anonymous external drag, no event.
 	isExternalInstanceGroupAllowed: function(eventInstanceGroup) {
 		var view = this._getView();
+		var dateProfile = view.get('dateProfile');
 		var eventFootprints = this.eventRangesToEventFootprints(eventInstanceGroup.getAllEventRanges());
 		var i;
 
 		for (i = 0; i < eventFootprints.length; i++) {
-			if (!view.validUnzonedRange.containsRange(eventFootprints[i].componentFootprint.unzonedRange)) {
+			if (!dateProfile.validUnzonedRange.containsRange(eventFootprints[i].componentFootprint.unzonedRange)) {
 				return false;
 			}
 		}

+ 1 - 1
src/component/interactions/DateSelecting.js

@@ -152,7 +152,7 @@ var DateSelecting = Interaction.extend({
 
 
 	isSelectionFootprintAllowed: function(componentFootprint) {
-		return this.view.validUnzonedRange.containsRange(componentFootprint.unzonedRange) &&
+		return this.view.get('dateProfile').validUnzonedRange.containsRange(componentFootprint.unzonedRange) &&
 			this.view.calendar.isSelectionFootprintAllowed(componentFootprint);
 	}
 

+ 1 - 1
src/component/interactions/EventDragging.js

@@ -198,7 +198,7 @@ var EventDragging = Interaction.extend({
 					eventDefMutation &&
 					view.renderDrag( // truthy if rendered something
 						component.eventRangesToEventFootprints(
-							mutatedEventInstanceGroup.sliceRenderRanges(view.renderUnzonedRange, calendar)
+							mutatedEventInstanceGroup.sliceRenderRanges(view.get('dateProfile').renderUnzonedRange, calendar)
 						),
 						seg,
 						dragListener.isTouch

+ 1 - 1
src/component/interactions/EventResizing.js

@@ -118,7 +118,7 @@ var EventResizing = Interaction.extend({
 
 					component.renderEventResize(
 						component.eventRangesToEventFootprints(
-							mutatedEventInstanceGroup.sliceRenderRanges(view.renderUnzonedRange, calendar)
+							mutatedEventInstanceGroup.sliceRenderRanges(view.get('dateProfile').renderUnzonedRange, calendar)
 						),
 						seg
 					);

+ 1 - 1
src/component/interactions/ExternalDropping.js

@@ -100,7 +100,7 @@ var ExternalDropping = Interaction.extend(ListenerMixin, {
 				if (singleEventDef) {
 					component.renderDrag( // called without a seg parameter
 						component.eventRangesToEventFootprints(
-							mutatedEventInstanceGroup.sliceRenderRanges(view.renderUnzonedRange, view.calendar)
+							mutatedEventInstanceGroup.sliceRenderRanges(view.get('dateProfile').renderUnzonedRange, view.calendar)
 						)
 					);
 				}

+ 3 - 2
src/list/ListView.js

@@ -56,8 +56,9 @@ var ListView = View.extend({
 
 	renderDates: function() {
 		var calendar = this.calendar;
-		var dayStart = calendar.msToUtcMoment(this.renderUnzonedRange.startMs, true);
-		var viewEnd = calendar.msToUtcMoment(this.renderUnzonedRange.endMs, true);
+		var dateProfile = this.get('dateProfile');
+		var dayStart = calendar.msToUtcMoment(dateProfile.renderUnzonedRange.startMs, true);
+		var viewEnd = calendar.msToUtcMoment(dateProfile.renderUnzonedRange.endMs, true);
 		var dayDates = [];
 		var dayRanges = [];
 

+ 8 - 4
tests/view-dates/ViewDateUtils.js

@@ -3,8 +3,10 @@ var ViewDateUtils = {
 
 	expectRenderRange: function(start, end) {
 		var currentView = currentCalendar.getView();
-		var renderRangeStart = currentCalendar.msToUtcMoment(currentView.renderUnzonedRange.startMs, currentView.isRangeAllDay);
-		var renderRangeEnd = currentCalendar.msToUtcMoment(currentView.renderUnzonedRange.endMs, currentView.isRangeAllDay);
+		var dateProfile = currentView.get('dateProfile');
+
+		var renderRangeStart = currentCalendar.msToUtcMoment(dateProfile.renderUnzonedRange.startMs, dateProfile.isRangeAllDay);
+		var renderRangeEnd = currentCalendar.msToUtcMoment(dateProfile.renderUnzonedRange.endMs, dateProfile.isRangeAllDay);
 
 		expect(renderRangeStart).toEqualMoment(start);
 		expect(renderRangeEnd).toEqualMoment(end);
@@ -12,8 +14,10 @@ var ViewDateUtils = {
 
 	expectActiveRange: function(start, end) {
 		var currentView = currentCalendar.getView();
-		var activeRangeStart = currentCalendar.msToUtcMoment(currentView.activeUnzonedRange.startMs, currentView.isRangeAllDay);
-		var activeRangeEnd = currentCalendar.msToUtcMoment(currentView.activeUnzonedRange.endMs, currentView.isRangeAllDay);
+		var dateProfile = currentView.get('dateProfile');
+
+		var activeRangeStart = currentCalendar.msToUtcMoment(dateProfile.activeUnzonedRange.startMs, dateProfile.isRangeAllDay);
+		var activeRangeEnd = currentCalendar.msToUtcMoment(dateProfile.activeUnzonedRange.endMs, dateProfile.isRangeAllDay);
 
 		expect(activeRangeStart).toEqualMoment(start);
 		expect(activeRangeEnd).toEqualMoment(end);