简体   繁体   中英

How can I localize FullCalendar in jQuery?

I'm trying to convert FullCalendar to Spanish.

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

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: ['一月', '二月', '三月', '四月', '五月', '六月', '七月',
    '八月', '九月', '十月', '十一月', '十二月']

    //...
})

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/

The easiest way is to search the source javascript code, almost at the very beginning of the production version of the script, around line 60 or so, there are all the names of months and days. Just change them to your language.

Note: For some reason in the minified version of the script is almost at the end.

It seems like your best bet is to get the source code yourself from http://github.com/arshaw/fullcalendar/ and manually search through to find the strings you need to translate.

You can change things like month names and day names in /src/defaults.js

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM