我正在使用全日历,以下是我的设置:
$(function () {
var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
$('#calendar').fullCalendar({
header: {
left: '',
center: '',
right: ''
},
defaultView: 'month',
lazyFetching: true,
timeFormat: {
// for agendaWeek and agendaDay
agenda: 'h:mmt', // 5:00 - 6:30
// for all other views
'': 'h:mmt' // 7p
},
isRTL: true,
lang: 'fa',
editable: true,
disableResizing: true,
dayNamesShort: ['یکشنبه', 'دوشنبه', 'سهشنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه', 'شنبه'],
firstDay: 6,
events: [
{
title : 'event1',
start : '2016-01-24'
},
{
title : 'event2',
start : '2016-01-24',
end : '2016-01-25'
},
{
title : 'event3',
start : '2016-01-22',
allDay : true // will make the time show
}
],
eventClick: function() {
alert('win');
}
});
});
单击事件时,不会触发任何操作。我到处找了,找不到任何答案。目前,我正在将FC与Symfony2集成。另外,这是我的资产:
<script src="{{ path('fos_js_routing_js', {'callback': 'fos.Router.setData'}) }}"></script>
<script src="{{ asset('js/moment.js') }}"></script>
<script src="{{ asset('bundles/adesignscalendar/js/fullcalendar/jquery.fullcalendar.min.js') }}"></script>
<script src="{{ asset('js/lang-all.js') }}"></script>
试试这个,
selectable: true,
eventClick: function( event, jsEvent, view ) {
// your code
}