简体   繁体   中英

Fullcalendar.io How to intercept 'prev' and 'next' from the header

I'm building an app using react with typescript and now for displaying a calendar I'm using Fullcalendar.io My problem is that I don't know how to intercept the event when you click on the header prev or next as you can see into the attached pic. The provided solution form the library is this . But I want to know if I can use another smart solution.

部分代码

Thanks in advice.

I'd like to bump this if I may (apologies if this is not allowed).

I have a similar requirement, to intercept the call to calendar.next(), or at least when the buttons are pressed (as I have no other call to the functions).

My requirement is due to a legal requirement that means I have to have text on my page be bilingual. As Welsh is not a supported locale option, I have to manually adjust the text.

I've had to do similar with Moment.js text, so piggybacking on the function I wrote for that (simple replace text function).

if (userData.languagePref > 1) {
    var calMonthText = $('.fc-left h2').text();

    var translatedText = translateMomentJsFromNowText(calMonthText);
    $('.fc-left h2').text(translatedText);
}

This is called after the calendar is initialised, and works on the initial display, however I need to run this when the next/prev buttons are used as well.

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