Skip to content

buttonText on ‘today’ view not updating

I’m updating the buttonText for ‘today’ in views and its not working.

Updating the buttonText for the other buttons works fine.

fullcalendar: {
    firstHour: 9,
    header: {
        left: 'prev,next today',
        center: 'title',
        right: 'listDay,listWeek,month,listMonth,'
    },
    slotMinutes: 30,
    theme:false,
    views: {
        today: {buttonText: 'Today'},
        listWeek: {buttonText: 'Week'},
        listDay: {buttonText: 'Day'},
        listMonth: {buttonText: 'List'},
        month: {buttonText: 'Month'}
    },
    defaultView: 'month'
},

‘today’ should be capitalized but its not…

Answer

Here’s demo using your code: http://jsfiddle.net/ocvpsLgt/ . The “today” button you’re seeing is the one defined in the left area of the header settings. It’s a standard navigation button defined by fullCalendar which changes the date to the current today. It has nothing to do with the custom view you tried to define which you named as today.

You can’t define a view which has the same name as a standard navigation button – if you put that name into the header, fullCalendar will just think you are referring to the standard button, and display that. In any case, it makes no sense to define a view called “Today” – a view describes the layout of the calendar, not a particular date. Today’s date can be reached from any type of view. You’ve already got “listDay” which will cover a single day – any day, including today. I can’t see why you’d want another day view, unless it was a different type, such as “agendaDay”.

If you just want to capitalise the name of the standard “today” button, then that can be done via the global buttonText setting:

buttonText: { today: "Today" }

Demo: http://jsfiddle.net/ocvpsLgt/1/