FullCalendar在我的RoR应用程序中实现,今天他正在做测试,我意识到日期和日期是不正确的。我工作得很好,直到这一天,创建一个新的应用程序,同样的事情发生了,今天是星期一,11月4日,我知道它不是 11月6日
var initialize_calendar;
initialize_calendar = function() {
$('.calendar').each(function(){
var calendar = $(this);
calendar.fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
today: 'hoy',
month: 'month',
week: 'week',
day: 'day',
right: 'month,agendaWeek,agendaDay'
},
allDayText: "Todo el dia",
buttonText: {
today: "Hoy",
month: "Mes",
week: "Semana",
day: "Hoy"
},
monthNames: ['Enero','Febrero','Marzo','Abril','Mayo','Junio','Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'],
monthNamesShort: ['Ene','Feb','Mar','Abr','May','Jun','Jul','Ago','Sep','Oct','Nov','Dic'],
dayNames: ['Lunes', 'Martes', 'Miercoles', 'Jueves','Viernes', 'Sabado', 'Domingo'],
dayNamesShort: ['Lun', 'Mar', 'Mier', 'Jue', 'Vie', 'Sab', 'Dom'],
defaultView: 'agendaDay',
selectable: true,
minTime: '08:00:00',
maxTime: '20:00:00',
slotDuration: '00:60:00',
hiddenDays: [ 5, 6 ],
selectHelper: true,
editable: true,
eventLimit: true,
events: '/events.json',
timezone: "local",
select: function(start, end) {
$.getScript('/events/new', function() {
$('#event_date_range').val(moment(start).format("MM/DD/YYYY HH:mm") + ' - ' + moment(end).format("MM/DD/YYYY HH:mm"))
date_range_picker();
$('.start_hidden').val(moment(start).format('YYYY-MM-DD HH:mm'));
$('.end_hidden').val(moment(end).format('YYYY-MM-DD HH:mm'));
});
calendar.fullCalendar('unselect');
},
eventDrop: function(event, delta, revertFunc) {
event_data = {
event: {
id: event.id,
start: event.start.format(),
end: event.end.format()
}
};
$.ajax({
url: event.update_url,
data: event_data,
type: 'PATCH'
});
},
eventClick: function(event, jsEvent, view) {
$.getScript(event.edit_url, function() {
$('#event_date_range').val(moment(event.start).format("MM/DD/YYYY HH:mm") + ' - ' + moment(event.end).format("MM/DD/YYYY HH:mm"))
date_range_picker();
$('.start_hidden').val(moment(event.start).format('YYYY-MM-DD HH:mm'));
$('.end_hidden').val(moment(event.end).format('YYYY-MM-DD HH:mm'));
});
}
});
})
};
$(document).on('turbolinks:load', initialize_calendar);
我不懂西班牙语,所以看不到错误;)
你需要启动你的dayNames
&dayNamesShort
阵列与Domingo。FullCalendar docs .
dayNames: ['Domingo', 'Lunes', 'Martes', 'Miercoles', 'Jueves', 'Viernes', 'Sabado'],
dayNamesShort: ['Dom', 'Lun', 'Mar', 'Mier', 'Jue', 'Vie', 'Sab']