mirror of
https://github.com/wassname/fullcalendar.git
synced 2026-08-11 11:18:47 +08:00
don't throw error if event's title is blank or null
This commit is contained in:
@@ -339,7 +339,7 @@ function AgendaEventRenderer() {
|
||||
htmlEscape(formatDates(event.start, event.end, opt('timeFormat'))) +
|
||||
"</div>" +
|
||||
"<div class='fc-event-title'>" +
|
||||
htmlEscape(event.title) +
|
||||
htmlEscape(event.title || '') +
|
||||
"</div>" +
|
||||
"</div>" +
|
||||
"<div class='fc-event-bg'></div>";
|
||||
|
||||
@@ -283,7 +283,9 @@ function DayEventRenderer() {
|
||||
"</span>";
|
||||
}
|
||||
html +=
|
||||
"<span class='fc-event-title'>" + htmlEscape(event.title) + "</span>" +
|
||||
"<span class='fc-event-title'>" +
|
||||
htmlEscape(event.title || '') +
|
||||
"</span>" +
|
||||
"</div>";
|
||||
if (segment.isEnd && isEventResizable(event)) {
|
||||
html +=
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link href='../build/out/fullcalendar.css' rel='stylesheet' />
|
||||
<link href='../build/out/fullcalendar.print.css' rel='stylesheet' media='print' />
|
||||
<script src='../build/out/jquery.js'></script>
|
||||
<script src='../build/out/jquery-ui.js'></script>
|
||||
<script src='../build/out/fullcalendar.js'></script>
|
||||
<script>
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
var date = new Date();
|
||||
var d = date.getDate();
|
||||
var m = date.getMonth();
|
||||
var y = date.getFullYear();
|
||||
|
||||
$('#calendar').fullCalendar({
|
||||
header: {
|
||||
left: 'prev,next today',
|
||||
center: 'title',
|
||||
right: 'month,agendaWeek,basicWeek,agendaDay,basicDay'
|
||||
},
|
||||
editable: true,
|
||||
events: [
|
||||
{
|
||||
title: null,
|
||||
start: new Date(y, m, 1)
|
||||
},
|
||||
{
|
||||
title: '',
|
||||
start: new Date(y, m, d-5),
|
||||
end: new Date(y, m, d-2)
|
||||
},
|
||||
{
|
||||
start: new Date(y, m, d, 10, 30),
|
||||
allDay: false
|
||||
}
|
||||
],
|
||||
eventRender: function(event, el) {
|
||||
el.find('.fc-event-title').text("something");
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
<style>
|
||||
|
||||
body {
|
||||
margin-top: 40px;
|
||||
text-align: center;
|
||||
font-size: 13px;
|
||||
font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif;
|
||||
}
|
||||
|
||||
#calendar {
|
||||
width: 900px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id='calendar'></div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user