How to translate the calendar header from Full Calendar? [closed]

closed. this question is out of scope and is not currently accepting answers.

want to improve this question? Update the question so it's on-topic for Stack Overflow.

Closed 2 years ago .

improve this question

Greetings, Friends of Stack Overflow! I am one step away from completing a calendar using the fantastic Full Calendar plugin, in which I am grateful to exist. However, I am having some translation problems with it:

Unfortunately, the locale/language property is not working properly in my code (I'm using C# with MVC5 and JS), so I'm having to translate by hand:

$('#calendar').fullCalendar({
    monthNames: ['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio',
        'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro',
        'Novembro', 'Dezembro'],
    dayNamesShort: ['Dom', 'Seg', 'Ter', 'Qua',
        'Qui', 'Sex', 'Sab'],

    defaultDate: new Date(),
    locale: 'pt-BR',
    header: {
        left: 'prev,next today',
        center: 'title',
        right: 'month,agendaWeek'
    },
    columnFormat: 'ddd',

So far everything is supimpa, but the only thing I am not able to translate in this way is the "Agenda Header" - the Damned refuses to stay in Portuguese, and I could not find in the documentation/on other sites a way to format only this property.

Here is an image that shows what I mean:

insert the description of the image here

I want to translate that part of Dec 31, 2017-Jan 6, 2018 into Portuguese, and into the correct format, but as I said, the property Locale is not working.

Something else:

I am aware that the Locale property only works with language JS (en-br.js) being called correctly. It is properly referenced in the folder locale and BundleScript used for this calendar.

insert the description of the image here

Author: Momentanius, 2018-01-02

1 answers

Hello I did as follows to translate everything

When unpacking the fullcalendar zip, you will have the address: fullcalendar / local / pt-br.js.

Call the file on the page in question

<script src='js/fullcalendar361/fullcalendar.js'></script>
<script src='js/fullcalendar361/locale/pt-br.js'></script>
<script src='js/fullcalendar361/lib/moment.min.js'></script>

$(document).ready(function() {

    $('#calendar').fullCalendar({
        // no script setar "pt-br"
        locale:  'pt-br',

I hope I helped

 0
Author: Wilson Rosa Gomes, 2018-03-16 16:45:19