# Customize calendar with javascript

**URL:** <https://forums.knack.com/t/customize-calendar-with-javascript/12743>\
**Category:** Ask Developers\
**Created:** [June 30, 2022, 6:02pm UTC](https://forums.knack.com/t/customize-calendar-with-javascript/12743 "2022-06-30T18:02:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Neil1](https://avatars.discourse-cdn.com/v4/letter/n/278dde/32.png) [@Neil1](https://forums.knack.com/u/Neil1)\
**Post date:** [June 30, 2022, 6:02pm UTC](https://forums.knack.com/t/customize-calendar-with-javascript/12743/1 "2022-06-30T18:02:35Z")

</div>

Hi all, I’m really hoping someone can help.

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.

Can anybody help?

With thanks in advance, Neil.

---

<div class="post-metadata">

**Author:** ![Sunny\_Singla](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/sunny_singla/32/1007_2.png) [@Sunny\_Singla](https://forums.knack.com/u/Sunny_Singla)\
**Post date:** [June 30, 2022, 7:58pm UTC](https://forums.knack.com/t/customize-calendar-with-javascript/12743/2 "2022-06-30T19:58:20Z")

</div>

Hello Neil,

Check out the page for the next and prev only  
[https://roberts.knack.com/farmers#calendar-test/](https://roberts.knack.com/farmers#calendar-test/)

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”);

```
}
else
	clicked = 0

```

});

Regards,  
Sunny Singla  
[info@sandt-consultancyservices.com](mailto:info@sandt-consultancyservices.com)

> **[Database consultant – Software database consultant](http://sandt-consultancyservices.com)**
>
> Knack Database consultant

---

<div class="post-metadata">

**Author:** ![Neil1](https://avatars.discourse-cdn.com/v4/letter/n/278dde/32.png) [@Neil1](https://forums.knack.com/u/Neil1)\
**Post date:** [June 30, 2022, 9:32pm UTC](https://forums.knack.com/t/customize-calendar-with-javascript/12743/3 "2022-06-30T21:32:55Z")

</div>

That’s just the job!

Thank you so much Sunny, you’re a hero 👍

---

<div class="post-metadata">

**Author:** ![Michael23](https://avatars.discourse-cdn.com/v4/letter/m/74df32/32.png) [@Michael23](https://forums.knack.com/u/Michael23)\
**Post date:** [November 13, 2023, 12:34pm UTC](https://forums.knack.com/t/customize-calendar-with-javascript/12743/4 "2023-11-13T12:34:15Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![Sunny\_Singla](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/sunny_singla/32/1007_2.png) [@Sunny\_Singla](https://forums.knack.com/u/Sunny_Singla)\
**Post date:** [December 29, 2023, 4:20am UTC](https://forums.knack.com/t/customize-calendar-with-javascript/12743/5 "2023-12-29T04:20:12Z")

</div>

Hello Michael,

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 .

Regards,  
Sunny Singla  
+919855089359  
[info@sandt-consultancyservices.com](mailto:info@sandt-consultancyservices.com)
