diff options
Diffstat (limited to 'views')
-rw-r--r-- | views/default/event_calendar/full_calendar_view.php | 67 |
1 files changed, 49 insertions, 18 deletions
diff --git a/views/default/event_calendar/full_calendar_view.php b/views/default/event_calendar/full_calendar_view.php index 7a40c6da9..adbb8a359 100644 --- a/views/default/event_calendar/full_calendar_view.php +++ b/views/default/event_calendar/full_calendar_view.php @@ -152,25 +152,56 @@ handleViewDisplay = function(view) { //$(".fc-widget-content[data-date='20120105']") } -$(document).ready(function() { - $('#calendar').fullCalendar({ - header: { - left: 'prev,next today', - center: 'title', - right: 'month,agendaWeek,agendaDay' - }, - month: <?php echo date('n',strtotime($vars['start_date']))-1; ?>, - ignoreTimezone: true, - editable: true, - slotMinutes: 15, - eventRender: handleEventRender, - eventDrop: handleEventDrop, - eventClick: handleEventClick, - dayClick: handleDayClick, - events: handleGetEvents, - viewDisplay: handleViewDisplay, +fullcalendarInit = function() { + + var loadFullCalendar = function() { + var locale = $.datepicker.regional[elgg.config.language]; + if (!locale) { + locale = $.datepicker.regional['']; + } + $('#calendar').fullCalendar({ + header: { + left: 'prev,next today', + center: 'title', + right: 'month,agendaWeek,agendaDay' + }, + month: <?php echo date('n',strtotime($vars['start_date']))-1; ?>, + ignoreTimezone: true, + editable: true, + slotMinutes: 15, + eventRender: handleEventRender, + eventDrop: handleEventDrop, + eventClick: handleEventClick, + dayClick: handleDayClick, + events: handleGetEvents, + viewDisplay: handleViewDisplay, + + isRTL: locale.isRTL, + firstDay: locale.firstDay, + monthNames: locale.monthNames, + monthNamesShort: locale.monthNamesShort, + dayNames: locale.dayNames, + dayNamesShort: locale.dayNamesShort, + buttonText: { + today: locale.currentText, + month: elgg.echo('event_calendar:month_label'), + week: elgg.echo('event_calendar:week_label'), + day: elgg.echo('event_calendar:day_label') + } + }); + } + + elgg.get({ + url: elgg.config.wwwroot + 'vendors/jquery/i18n/jquery.ui.datepicker-'+ elgg.get_language() +'.js', + dataType: "script", + cache: true, + success: loadFullCalendar, + error: loadFullCalendar, // english language is already loaded. }); -}); +} + +elgg.register_hook_handler('init', 'system', fullcalendarInit); + </script> <div id='calendar'></div> <input type="hidden" id="event-calendar-selected-date" /> |