I’m creating an app with 2 calendars side by side in day view. I want to keep the calendars synchronised so that when clicking the ‘previous’, ‘next’ or ‘today’ buttons on one calendar executes the action on both calendars.
I’m sure this can be achieved in javascript, but I’ll be damned if I can make it work.
change id’s as per your view
var clicked = 0;
$(“#view_97 .fc-button-prev”).live(“click”, function () {
if (clicked == 0) {
clicked = 1;
$(“#view_39 .fc-button-prev”).trigger(“click”);
}
else
clicked = 0
});
$(“#view_39 .fc-button-prev”).live(“click”, function () {
if (clicked == 0) {
clicked = 1;
$(“#view_97 .fc-button-prev”).trigger(“click”);
}
else
clicked = 0
});
$(“#view_97 .fc-button-next”).live(“click”, function () {
if (clicked == 0) {
clicked = 1;
$(“#view_39 .fc-button-next”).trigger(“click”);
}
else
clicked = 0
});
$(“#view_39 .fc-button-next”).live(“click”, function () {
if (clicked == 0) {
clicked = 1;
$(“#view_97 .fc-button-next”).trigger(“click”);
This is great! Actually, I’m wondering if someone can help me too. In Knack calendar view, let’s say someone is entering dates in December (but the “today” view is November), when someone enters dates in the future, it refreshes back to November. Is there a way that it refreshes to the current month/day last viewed? Please help!
Yes, that’s possible as well using javascript. we can save that value in some object and when load we can check the month and year and go to that date .