Can't you use a third-party Js library like full-Calendar or some other jQuery calendars as they provide almost all of the functionings.
see the link
you can also check this link
it describes to override the default API function " SP.UI.ApplicationPages.CalendarContainerFactory.create " of the SharePoint calendar view and apply a custom hook of your own as posted below.
ExecuteOrDelayUntilScriptLoaded(
MyCalendarHook,
"SP.UI.ApplicationPages.Calendar.js");
function MyCalendarHook() {
var _patchCalendar = function() {
$('.ms-acal-rootdiv .ms-acal-item').click(function () {
var itemId = $('a', $(this)).attr('href').split('?ID=')[1];
alert('Item with ID ' + itemId + ' was clicked!');
});
};
var _onItemsSucceed = SP.UI.ApplicationPages.CalendarStateHandler.prototype.onItemsSucceed;
SP.UI.ApplicationPages.CalendarStateHandler.prototype.onItemsSucceed = function($p0, $p1) {
_onItemsSucceed.call(this, $p0, $p1);
_patchCalendar();
};
}
and add this script file in your v4.master head tag as show below. (Script included between BEGIN DEMO and END DEMO )
<head runat="server">
<meta http-equiv="X-UA-Compatible" content="IE=8"/>
<meta name="GENERATOR" content="Microsoft SharePoint"/>
<meta name="progid" content="SharePoint.WebPartPage.Document"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="Expires" content="0"/>
<SharePoint:RobotsMetaTag runat="server"/>
<title id="onetidTitle"><asp:ContentPlaceHolder id="PlaceHolderPageTitle" runat="server"/></title>
<SharePoint:CssLink runat="server" Version="4"/>
<SharePoint:Theme runat="server"/>
<SharePoint:ULSClientConfig runat="server"/>
<script type="text/javascript">
var _fV4UI = true;
</script>
<SharePoint:ScriptLink language="javascript" name="core.js" OnDemand="true" runat="server"/>
<SharePoint:CustomJSUrl runat="server"/>
<SharePoint:SoapDiscoveryLink runat="server"/>
<asp:ContentPlaceHolder id="PlaceHolderAdditionalPageHead" runat="server"/>
<SharePoint:DelegateControl runat="server" ControlId="AdditionalPageHead" AllowMultipleControls="true"/>
<SharePoint:SPShortcutIcon runat="server" IconUrl="/_layouts/images/favicon.ico"/>
<asp:ContentPlaceHolder id="PlaceHolderBodyAreaClass" runat="server"/>
<!-- BEGIN DEMO -->
<script type="text/javascript" src="/_layouts/js/jquery-1.6.1.js"></script>
<script type="text/javascript" src="/_layouts/js/patchcalendar.js"></script>
<!-- END DEMO -->
<asp:ContentPlaceHolder id="PlaceHolderTitleAreaClass" runat="server"/>
<SharePoint:SPPageManager runat="server"/>
<SharePoint:SPHelpPageComponent Visible="false" runat="server"/>
</head>