giuseppe giuseppe - 15 days ago 11
jQuery Question

jquery FullCalendar wrong day

I just setup a running jquery Fullcalendar.
But I notice that the calendar shows a wrong day.
Today is 2014-03-21 (Friday) and It is saying that it is Saturday (Sab in italian)

enter image description here

FullCalendar version is 1.6 (the latest).
This is the setup of the calendar:

$('#calendar').fullCalendar({

header: {
left: 'title',
center: '',
right: 'prev next '
},

defaultView: 'month',
firstHour: 8,
weekMode: 'variable',
aspectRatio: 2,
editable: true,
ignoreTimezone:false,

contentHeight:950,
monthNames:

['Gennaio','Febbraio','Marzo','Aprile','Maggio','Giugno','Luglio','Agosto',
'Settembre','Ottobre','Novembre','Dicembre'],
monthNamesShort:['Gen','Feb','Mar','Apr','Mag','Giu','Lug','Ago',
'Set','Ott','Nov','Dic'],
dayNames:

['Lunedì','Martedì','Mercoledì','Giovedì','Venerdì','Sabato','Domenica'],
dayNamesShort:['Lun','Mar','Mer','Gio','Ven','Sab','Dom']


}); // end fullcalendar


The problem is independent of events: I tried also without any loaded event.

Answer

The option dayNames must start from Sunday as per en-us locale, so change your arrays accodingly in:

dayNames:

['Domenica','Lunedì', 'Martedì', 'Mercoledì', 'Giovedì', 'Venerdì', 'Sabato'],
dayNamesShort: ['Dom','Lun', 'Mar', 'Mer', 'Gio', 'Ven', 'Sab']

Ref: http://arshaw.com/fullcalendar/docs/text/dayNames/ and http://arshaw.com/fullcalendar/docs/text/dayNamesShort/

Demo: http://jsfiddle.net/IrvinDominin/4MSYZ/

Comments