2014-12-06 70 views
1

我在我的网站中使用fullcalendar.js进行预订系统。我使用的功能在fullcalendar或任何特定事件中转到特定日期时间

$('#calendar').fullCalendar('gotoDate', new Date()); 

问题,我面对的是,它需要我在日历中所需的日期,但我也想移动到特定的时间跨度在日历。

任何人都可以在这一点上帮助我吗?

谢谢 Manoj。

回答

-1

$('#calendar').fullCalendar({ 
 
\t header: { 
 
\t \t left: 'prev,next today', 
 
\t \t center: 'title', 
 
\t \t right: 'month,agendaWeek,agendaDay' 
 
\t }, 
 
\t defaultDate: '2015-02-02', 
 
\t defaultView: 'month', 
 
\t slotDuration: '00:10:00', 
 
\t minTime: "8:00:00", 
 
\t maxTime: "20:00:00", 
 
\t selectable: true, 
 
\t selectHelper: true, 
 
\t dayClick: function(date, jsEvent, view) { 
 
\t \t if (view.name == 'month') { 
 
\t \t \t $('#calendar').fullCalendar('changeView', 'agendaDay'); 
 
\t \t \t $('#calendar').fullCalendar('gotoDate', start); 
 
\t \t } 
 
\t \t else { 
 
\t \t \t alert('Clicked on: ' + date.format()); 
 
\t \t \t alert('Current view: ' + view.name); 
 
\t \t } 
 
\t }, 
 
\t editable: true, 
 
\t eventClick: function(event, element) { 
 
\t \t alert(event.title + " click on " + event.start.format() + " end time " + event.end.format()); 
 
\t }, 
 
\t eventDrop: function(event, delta, revertFunc) { 
 
\t \t if (!confirm("Are you sure about this change?")) { 
 
\t \t \t revertFunc(); 
 
\t \t \t $('#calendar').fullCalendar('rerenderEvents') 
 
\t \t } 
 
\t \t alert(event.title + " was dropped on " + event.start.format() + " end time " + event.end.format()); 
 
\t }, 
 
\t eventResize: function(event, delta, revertFunc) { 
 
\t \t if (!confirm("Are you sure about this change?")) { 
 
\t \t \t revertFunc(); 
 
\t \t \t $('#calendar').fullCalendar('rerenderEvents'); 
 
\t \t } 
 
\t }, 
 
\t eventLimit: true, 
 
\t views: { 
 
\t \t agenda: { 
 
\t \t \t eventLimit: 2 // adjust to 6 only for agendaWeek/agendaDay 
 
\t \t } 
 
\t }, 
 
\t events: [ 
 
\t \t \t { 
 
\t \t \t \t id: 9, 
 
\t \t \t \t title: 'dinner', 
 
\t \t \t \t start: '2015-02-16T10:00:00', 
 
\t \t \t \t end: '2015-02-16T10:30:00' 
 
\t \t \t }, 
 
\t \t \t { 
 
\t \t \t \t id: 9, 
 
\t \t \t \t title: 'lunch', 
 
\t \t \t \t start: '2015-02-17T10:00:00', 
 
\t \t \t \t end: '2015-02-17T10:30:00' 
 
\t \t \t }, 
 
\t \t \t { 
 
\t \t \t \t id: 9, 
 
\t \t \t \t title: 'breakfast', 
 
\t \t \t \t start: '2015-02-18T10:00:00', 
 
\t \t \t \t end: '2015-02-18T10:30:00' 
 
\t \t \t }, 
 
\t \t \t { 
 
\t \t \t \t id: 9, 
 
\t \t \t \t title: 'full event', 
 
\t \t \t \t start: '2015-02-17', 
 
\t \t \t \t end: '2015-02-17' 
 
\t \t \t } 
 
\t \t \t ] 
 
});

+1

而是张贴的代码墙,请考虑将它写的每一部分如何解决问题的一些解释。 – 2015-02-17 05:24:34

相关问题