Permalink
Browse files

Fixed bug with event rendering.

  • Loading branch information...
1 parent 6275c73 commit 8ca69732aa3e2172a77eb289deb255bb7b2a9e91 Scott Greenfield committed with alassek Oct 11, 2011
Showing with 85 additions and 75 deletions.
  1. +82 −74 demos/limit-events.html
  2. +3 −1 src/viewmore/fullcalendar.viewmore.js
View
@@ -15,86 +15,94 @@
<script type='text/javascript' src='../fullcalendar/fullcalendar.min.js'></script>
]]-->
<script type='text/javascript'>
+ $(document).ready(function(){
+ var date = new Date();
+ var d = date.getDate();
+ var m = date.getMonth();
+ var y = date.getFullYear();
- $(document).ready(function() {
-
- var date = new Date();
- var d = date.getDate();
- var m = date.getMonth();
- var y = date.getFullYear();
-
- $('#calendar').fullCalendar({
- editable: true,
- events: [
- {
- title: 'All Day Event',
- start: new Date(y, m, 1)
- },
- {
- title: 'Long Event',
- start: new Date(y, m, d-5),
- end: new Date(y, m, d-2)
- },
- {
- id: 999,
- title: 'Repeating Event',
- start: new Date(y, m, d-3, 16, 0),
- allDay: false
- },
- {
- id: 999,
- title: 'Repeating Event',
- start: new Date(y, m, d+4, 16, 0),
- allDay: false
- },
- {
- title: 'Meeting',
- start: new Date(y, m, d, 10, 30),
- allDay: false
- },
- {
- title: 'Lunch',
- start: new Date(y, m, d, 12, 0),
- end: new Date(y, m, d, 14, 0),
- allDay: false
- },
- {
- title: 'Birthday Party',
- start: new Date(y, m, d+1, 19, 0),
- end: new Date(y, m, d+1, 22, 30),
- allDay: false
- },
- {
- title: 'Click for Google',
- start: new Date(y, m, 28),
- end: new Date(y, m, 29),
- url: 'http://google.com/'
- }
- ]
- });
-
- $('#calendar').limitEvents(2);
-
- });
-
+ $('#calendar').fullCalendar({
+ editable: true,
+ events: [{
+ title: 'All Day Event',
+ start: new Date(y, m, 1)
+ },
+ {
+ title: 'Long Event',
+ start: new Date(y, m, d-5),
+ end: new Date(y, m, d-2)
+ },
+ {
+ id: 999,
+ title: 'Repeating Event',
+ start: new Date(y, m, d-3, 16, 0),
+ allDay: false
+ },
+ {
+ id: 999,
+ title: 'Repeating Event',
+ start: new Date(y, m, d+4, 16, 0),
+ allDay: false
+ },
+ {
+ title: 'Meeting',
+ start: new Date(y, m, d, 10, 30),
+ allDay: false
+ },
+ {
+ title: 'Meeting2',
+ start: new Date(y, m, d, 10, 50),
+ allDay: false
+ },
+ {
+ title: 'Meeting3',
+ start: new Date(y, m, d, 11, 50),
+ allDay: false
+ },
+ {
+ title: 'Meeting4',
+ start: new Date(y, m, d, 12, 20),
+ allDay: false
+ },
+ {
+ title: 'Lunch',
+ start: new Date(y, m, d, 12, 50),
+ end: new Date(y, m, d, 14, 0),
+ allDay: false
+ },
+ {
+ title: 'Birthday Party',
+ start: new Date(y, m, d+1, 19, 0),
+ end: new Date(y, m, d+1, 22, 30),
+ allDay: false
+ },
+ {
+ title: 'Click for Google',
+ start: new Date(y, m, 28),
+ end: new Date(y, m, 29),
+ url: 'http://google.com/'
+ }]
+ }).limitEvents(3);
+ });
</script>
-<style type='text/css'>
-
- body {
- margin-top: 40px;
- text-align: center;
- font-size: 14px;
- font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif;
- }
- #calendar {
- width: 900px;
- margin: 0 auto;
- }
+<style type='text/css'>
+ body{
+ margin-top: 40px;
+ text-align: center;
+ font-size: 14px;
+ font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif;
+ }
+ #calendar {
+ width: 900px;
+ margin: 0 auto;
+ }
</style>
</head>
+
<body>
-<div id='calendar'></div>
+ <div id="calendar"></div>
</body>
+
</html>
@@ -30,7 +30,8 @@
var limit = new $.fn.limitEvents.constructor($(this));
$.extend({ maxEvents: 4 }, opts); //defaults
- $(this).fullCalendar('limitEvents', opts);
+ $(this).fullCalendar('limitEvents', opts)
+ .fullCalendar('rerenderEvents');
});
};
@@ -67,6 +68,7 @@
self.calendar.delegate('.fc-button-prev, .fc-button-next', 'click', function(){
resetEventsRangeCounts();
+ self.calendar.fullCalendar('rerenderEvents');
});
};

0 comments on commit 8ca6973

Please sign in to comment.