Sample script to overwrite OOB calendar function to do customization(filter for this case).
<script type="text/javascript">
function searchCalendar() {
window.location = window.location;
}
ExecuteOrDelayUntilScriptLoaded(CustomizeCalendarEvents, "SP.UI.ApplicationPages.Calendar.js");
function CustomizeCalendarEvents() {
var _onItemsSucceed = SP.UI.ApplicationPages.CalendarStateHandler.prototype.onItemsSucceed;
SP.UI.ApplicationPages.CalendarStateHandler.prototype.onItemsSucceed = function ($p0, $p1) {
if (this.$K_1.$8G_0()) {
this.$28_1();
return;
}
this.$41_1 = false;
if (this.$3G_1) {
this.$D_1.$4T_1();
this.$3G_1 = false;
}
if (SP.UI.ApplicationPages.SU.$2(this.$39_1[this.$j_1])) {
this.$39_1[this.$j_1] = [];
}
Array.addRange(this.$39_1[this.$j_1], $p0);
this.$D_1.$7S_1(this.$j_1, this.$v_1, $p1, this.$39_1[this.$j_1]);
this.$j_1++;
this.$1h_1();
alert('callback');
//to do filter logic
}
}
</script>
<input id="Button1" onclick="searchCalendar()" type="button" value="button" />
Get event properties for filter, you may check below thread.
https://social.msdn.microsoft.com/Forums/office/en-US/6ead033b-4f9c-48a6-9a6d-a395fdb424b9/share-point-2010-calendar?forum=sharepointdevelopmentprevious