Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I localize FullCalendar in jQuery?

I'm trying to convert FullCalendar to Spanish.

How can I change "Next Week", "Today", etc.?

like image 856
wenceslao leon Avatar asked Oct 01 '10 14:10

wenceslao leon


People also ask

How do I get the date from FullCalendar?

Calendar::getDate Returns a Date for the current date of the calendar. For month view, it will always be some time between the first and last day of the month.

How do I select multiple dates in FullCalendar?

Detect when the user clicks on dates or times. Give the user the ability to select multiple dates or time slots with their mouse or touch device. Allows a user to highlight multiple days or timeslots by clicking and dragging.

How do I re render FullCalendar?

fullCalendar('destroy'); $('#calendar'). fullCalendar('render'); If you don't actually need to render the table, but just rerender the events again, you could use the 'rerenderEvents' method: $('#calendar').

How do I set events in FullCalendar?

Here is an example of how to specify an array of events: var calendar = new Calendar(calendarEl, { events: [ { title : 'event1', start : '2010-01-01' }, { title : 'event2', start : '2010-01-05', end : '2010-01-07' }, { title : 'event3', start : '2010-01-09T12:30:00', allDay : false // will make the time show } ] });


2 Answers

I ran into the same issue. The quickest way I found was to use the text/time customization hooks provided by full calendar:

$('#calendar').fullCalendar({
    events: "/calendar",

    //localize the month names to Chinese simplified
    monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', '七月',
    '八月', '九月', '十月', '十一月', '十二月']

    //...
})
like image 196
tstyle Avatar answered Oct 04 '22 03:10

tstyle


FullCalendar provides localisation files - that is the correct way to do this. How to use them is documented here: http://fullcalendar.io/docs/text/lang/

UPDATE: Should now use locale- https://fullcalendar.io/docs/text/locale/

like image 35
Jan Peša Avatar answered Oct 04 '22 02:10

Jan Peša