Change months of fullcalendar to any language

Change months of fullcalendar to any language

Howdy Reader,

While working with one of the application, I came across the functionality to change the calendar so that It gets rendered in Spanish language.

The application was using FullCalendar.js plugin to list all the calendar events and related functionality. It was decided to add multi lingual support to the calendar. Hence, extending it to one level up. So we came up with the solution to change the fullcalendar.js to new version (v2.6) as the previous version (v1.6) doesn’t include support for multiple languages.

In this article, I am going to cover:

  • How can you change months or days of fullcalendar to spanish or any language?
  • How to use fullcalendar.js plugin in your application with multiple language support?

Change months of fullcalendar to any language

For changing months or days of fullcalendar to Spanish or any other language, you need to follow the instructions given below:

  1. Download the fullcalendar.js latest version from here – fullcalendar.js
  2. Download the language’s JavaScript data file in order to use it. For example if you want to use Spanish then download “es.js” file.

 

If you are using one language, you do not need to specify the lang option. However, if more than one language file is loaded, or the combined “lang-all.js" file is loaded, you must explicitly specify which language to use with lang option:

 

If you want to achieve the stated functionality without loading the language files, you need to hard code the month names in the language you want to display the calendar.So when you invoke the calendar just pass the names of the months in spanish as shown below:

 

This is how you add months or days in Spanish or in any other language in fullcalendar.js plugin.

References:

  • You can see the live example of the calendar plugin by clicking this link – Demo

What do you think?

Dear Reader,
If you have any questions or suggestions please feel free to email us or put your thoughts as comments below. We would love to hear from you. If you found this post or article useful then please share along with your friends and help them to learn.

Happy Learning :)