aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorSem <sembrestels@riseup.net>2012-08-29 20:20:37 +0200
committerSem <sembrestels@riseup.net>2012-08-29 20:20:37 +0200
commit0eda6a0b003c84729176be8e069b7e5ab9d9f43c (patch)
tree88bab5863c6c5c78ba73620ef2a9e2c111607da5 /views
parentb09a37dc19b6af698b70bae21587c473ca98a3f6 (diff)
downloadelgg-0eda6a0b003c84729176be8e069b7e5ab9d9f43c.tar.gz
elgg-0eda6a0b003c84729176be8e069b7e5ab9d9f43c.tar.bz2
Internationalized fullcalendar.
Diffstat (limited to 'views')
-rw-r--r--views/default/event_calendar/full_calendar_view.php67
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" />