Set the right locale to the fullcalendar instances
This commit is contained in:
parent
5e260c7cfd
commit
0bb02ae2bf
4 changed files with 12 additions and 8 deletions
|
@ -132,6 +132,8 @@ class EA_Controller extends CI_Controller {
|
|||
'index_page' => config('index_page'),
|
||||
'available_languages' => config('available_languages'),
|
||||
'csrf_token' => $this->security->get_csrf_hash(),
|
||||
'language' => config('language'),
|
||||
'language_code' => config('language_code'),
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
@ -46,6 +46,14 @@ window.App = (function () {
|
|||
|
||||
$(document).ajaxError(onAjaxError);
|
||||
|
||||
$(function() {
|
||||
if (window.moment) {
|
||||
window.moment.locale(vars('language_code'));
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
return {
|
||||
Components: {},
|
||||
Http: {},
|
||||
|
|
|
@ -1448,6 +1448,7 @@ App.Utils.CalendarDefaultView = (function () {
|
|||
// Initialize page calendar
|
||||
fullCalendar = new FullCalendar.Calendar($calendar[0], {
|
||||
initialView,
|
||||
locale: vars('language_code'),
|
||||
nowIndicator: true,
|
||||
height: getCalendarHeight(),
|
||||
editable: true,
|
||||
|
@ -1461,14 +1462,6 @@ App.Utils.CalendarDefaultView = (function () {
|
|||
eventColor: '#7cbae8',
|
||||
slotLabelFormat: slotTimeFormat,
|
||||
allDayContent: lang('all_day'),
|
||||
views: {
|
||||
timeGridDay: {
|
||||
dayHeaderFormat: columnFormat
|
||||
},
|
||||
timeGridWeek: {
|
||||
dayHeaderFormat: columnFormat
|
||||
}
|
||||
},
|
||||
selectable: true,
|
||||
selectMirror: true,
|
||||
themeSystem: 'bootstrap5',
|
||||
|
|
|
@ -676,6 +676,7 @@ App.Utils.CalendarTableView = (function () {
|
|||
const firstWeekdayNumber = App.Utils.Date.getWeekdayId(firstWeekday);
|
||||
|
||||
const fullCalendar = new FullCalendar.Calendar($wrapper[0], {
|
||||
locale: vars('language_code'),
|
||||
initialView: 'timeGridDay',
|
||||
nowIndicator: true,
|
||||
height: getCalendarHeight(),
|
||||
|
|
Loading…
Reference in a new issue