bugfixrelease fullcalendar-3.0.1

This commit is contained in:
Mario Vavti 2016-10-05 20:39:50 +02:00
parent 26ea11c44f
commit 50c5f8c389
8 changed files with 138 additions and 45 deletions

View File

@ -1,4 +1,15 @@
v3.0.1 (2016-09-26)
-------------------
Bugfixes:
- list view rendering event times incorrectly (#3334)
- list view rendering events/days out of order (#3347)
- events with no title rendering as "undefined"
- add .fc scope to table print styles (#3343)
- "display no events" text fix for German (#3354)
v3.0.0 (2016-09-04) v3.0.0 (2016-09-04)
------------------- -------------------

View File

@ -1,5 +1,5 @@
/*! /*!
* FullCalendar v3.0.0 Stylesheet * FullCalendar v3.0.1 Stylesheet
* Docs & License: http://fullcalendar.io/ * Docs & License: http://fullcalendar.io/
* (c) 2016 Adam Shaw * (c) 2016 Adam Shaw
*/ */

View File

@ -1,5 +1,5 @@
/*! /*!
* FullCalendar v3.0.0 * FullCalendar v3.0.1
* Docs & License: http://fullcalendar.io/ * Docs & License: http://fullcalendar.io/
* (c) 2016 Adam Shaw * (c) 2016 Adam Shaw
*/ */
@ -19,7 +19,7 @@
;; ;;
var FC = $.fullCalendar = { var FC = $.fullCalendar = {
version: "3.0.0", version: "3.0.1",
internalApiVersion: 6 internalApiVersion: 6
}; };
var fcViews = FC.views = {}; var fcViews = FC.views = {};
@ -1574,6 +1574,49 @@ function chunkFormatString(formatStr) {
return chunks; return chunks;
} }
// Misc Utils
// -------------------------------------------------------------------------------------------------
// granularity only goes up until day
// TODO: unify with similarUnitMap
var tokenGranularities = {
Y: { value: 1, unit: 'year' },
M: { value: 2, unit: 'month' },
W: { value: 3, unit: 'week' },
w: { value: 3, unit: 'week' },
D: { value: 4, unit: 'day' }, // day of month
d: { value: 4, unit: 'day' } // day of week
};
// returns a unit string, either 'year', 'month', 'day', or null
// for the most granular formatting token in the string.
FC.queryMostGranularFormatUnit = function(formatStr) {
var chunks = getFormatStringChunks(formatStr);
var i, chunk;
var candidate;
var best;
for (i = 0; i < chunks.length; i++) {
chunk = chunks[i];
if (chunk.token) {
candidate = tokenGranularities[chunk.token.charAt(0)];
if (candidate) {
if (!best || candidate.value > best.value) {
best = candidate;
}
}
}
}
if (best) {
return best.unit;
}
return null;
};
;; ;;
FC.Class = Class; // export FC.Class = Class; // export
@ -13214,21 +13257,36 @@ var ListViewGrid = Grid.extend({
// slices by day // slices by day
spanToSegs: function(span) { spanToSegs: function(span) {
var view = this.view; var view = this.view;
var dayStart = view.start.clone(); var dayStart = view.start.clone().time(0); // timed, so segs get times!
var dayEnd; var dayIndex = 0;
var seg; var seg;
var segs = []; var segs = [];
while (dayStart < view.end) { while (dayStart < view.end) {
dayEnd = dayStart.clone().add(1, 'day');
seg = intersectRanges(span, { seg = intersectRanges(span, {
start: dayStart, start: dayStart,
end: dayEnd end: dayStart.clone().add(1, 'day')
}); });
if (seg) { if (seg) {
seg.dayIndex = dayIndex;
segs.push(seg); segs.push(seg);
} }
dayStart = dayEnd;
dayStart.add(1, 'day');
dayIndex++;
// detect when span won't go fully into the next day,
// and mutate the latest seg to the be the end.
if (
seg && !seg.isEnd && span.end.hasTime() &&
span.end < dayStart.clone().add(this.view.nextDayThreshold)
) {
seg.end = span.end.clone();
seg.isEnd = true;
break;
}
} }
return segs; return segs;
@ -13261,11 +13319,12 @@ var ListViewGrid = Grid.extend({
if (!segs.length) { if (!segs.length) {
this.renderEmptyMessage(); this.renderEmptyMessage();
return segs;
} }
else { else {
return this.renderSegList(segs); this.renderSegList(segs);
} }
return segs;
}, },
renderEmptyMessage: function() { renderEmptyMessage: function() {
@ -13280,30 +13339,47 @@ var ListViewGrid = Grid.extend({
); );
}, },
// render the event segments in the view. returns the mutated array. // render the event segments in the view
renderSegList: function(segs) { renderSegList: function(allSegs) {
var segsByDay = this.groupSegsByDay(allSegs); // sparse array
var dayIndex;
var daySegs;
var i;
var tableEl = $('<table class="fc-list-table"><tbody/></table>'); var tableEl = $('<table class="fc-list-table"><tbody/></table>');
var tbodyEl = tableEl.find('tbody'); var tbodyEl = tableEl.find('tbody');
var i, seg;
var dayDate;
this.sortEventSegs(segs); for (dayIndex = 0; dayIndex < segsByDay.length; dayIndex++) {
daySegs = segsByDay[dayIndex];
if (daySegs) { // sparse array, so might be undefined
for (i = 0; i < segs.length; i++) { // append a day header
seg = segs[i]; tbodyEl.append(this.dayHeaderHtml(
this.view.start.clone().add(dayIndex, 'days')
));
// append a day header this.sortEventSegs(daySegs);
if (!dayDate || !seg.start.isSame(dayDate, 'day')) {
dayDate = seg.start.clone().stripTime(); for (i = 0; i < daySegs.length; i++) {
tbodyEl.append(this.dayHeaderHtml(dayDate)); tbodyEl.append(daySegs[i].el); // append event row
}
} }
tbodyEl.append(seg.el); // append event row
} }
this.el.empty().append(tableEl); this.el.empty().append(tableEl);
},
return segs; // return the sorted list // Returns a sparse array of arrays, segs grouped by their dayIndex
groupSegsByDay: function(segs) {
var segsByDay = []; // sparse array
var i, seg;
for (i = 0; i < segs.length; i++) {
seg = segs[i];
(segsByDay[seg.dayIndex] || (segsByDay[seg.dayIndex] = []))
.push(seg);
}
return segsByDay;
}, },
// generates the HTML for the day headers that live amongst the event rows // generates the HTML for the day headers that live amongst the event rows
@ -13341,13 +13417,20 @@ var ListViewGrid = Grid.extend({
var url = event.url; var url = event.url;
var timeHtml; var timeHtml;
if (!seg.start.hasTime()) { if (event.allDay) {
if (this.displayEventTime) { timeHtml = view.getAllDayHtml();
}
else if (view.isMultiDayEvent(event)) { // if the event appears to span more than one day
if (seg.isStart || seg.isEnd) { // outer segment that probably lasts part of the day
timeHtml = htmlEscape(this.getEventTimeText(seg));
}
else { // inner segment that lasts the whole day
timeHtml = view.getAllDayHtml(); timeHtml = view.getAllDayHtml();
} }
} }
else { else {
timeHtml = htmlEscape(this.getEventTimeText(event)); // might return empty // Display the normal time text for the *event's* times
timeHtml = htmlEscape(this.getEventTimeText(event));
} }
if (url) { if (url) {
@ -13355,9 +13438,9 @@ var ListViewGrid = Grid.extend({
} }
return '<tr class="' + classes.join(' ') + '">' + return '<tr class="' + classes.join(' ') + '">' +
(timeHtml ? (this.displayEventTime ?
'<td class="fc-list-item-time ' + view.widgetContentClass + '">' + '<td class="fc-list-item-time ' + view.widgetContentClass + '">' +
timeHtml + (timeHtml || '') +
'</td>' : '</td>' :
'') + '') +
'<td class="fc-list-item-marker ' + view.widgetContentClass + '">' + '<td class="fc-list-item-marker ' + view.widgetContentClass + '">' +
@ -13369,7 +13452,7 @@ var ListViewGrid = Grid.extend({
'</td>' + '</td>' +
'<td class="fc-list-item-title ' + view.widgetContentClass + '">' + '<td class="fc-list-item-title ' + view.widgetContentClass + '">' +
'<a' + (url ? ' href="' + htmlEscape(url) + '"' : '') + '>' + '<a' + (url ? ' href="' + htmlEscape(url) + '"' : '') + '>' +
htmlEscape(seg.event.title) + htmlEscape(seg.event.title || '') +
'</a>' + '</a>' +
'</td>' + '</td>' +
'</tr>'; '</tr>';
@ -13384,7 +13467,6 @@ fcViews.list = {
buttonTextKey: 'list', // what to lookup in locale files buttonTextKey: 'list', // what to lookup in locale files
defaults: { defaults: {
buttonText: 'list', // text to display for English buttonText: 'list', // text to display for English
listTime: true, // show the time column?
listDayFormat: 'LL', // like "January 1, 2016" listDayFormat: 'LL', // like "January 1, 2016"
noEventsMessage: 'No events to display' noEventsMessage: 'No events to display'
} }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
/*! /*!
* FullCalendar v3.0.0 Print Stylesheet * FullCalendar v3.0.1 Print Stylesheet
* Docs & License: http://fullcalendar.io/ * Docs & License: http://fullcalendar.io/
* (c) 2016 Adam Shaw * (c) 2016 Adam Shaw
*/ */
@ -32,11 +32,11 @@
/* Table & Day-Row Restyling /* Table & Day-Row Restyling
--------------------------------------------------------------------------------------------------*/ --------------------------------------------------------------------------------------------------*/
th, .fc th,
td, .fc td,
hr, .fc hr,
thead, .fc thead,
tbody, .fc tbody,
.fc-row { .fc-row {
border-color: #ccc !important; border-color: #ccc !important;
background: #fff !important; background: #fff !important;

View File

@ -1,5 +1,5 @@
/*! /*!
* FullCalendar v3.0.0 Google Calendar Plugin * FullCalendar v3.0.1 Google Calendar Plugin
* Docs & License: http://fullcalendar.io/ * Docs & License: http://fullcalendar.io/
* (c) 2016 Adam Shaw * (c) 2016 Adam Shaw
*/ */

File diff suppressed because one or more lines are too long