Hi All
I have Jquery for calender control ,it is working upto IE8 but in IE11 it's not working
please see the below code what i am using now could please give the solution it is very helpful to me
var activeElements = new Array();
var activeElementCount = 0;
var calContainer;
function leapYear(year)
{
if((year%4)==0)
{
return true;
}
else
{
return false;
}
}
function checkDay(digit)
{
if(digit < 10)
{
return "0" + digit;
}
else
{
return digit;
}
}
function checkMonth(month)
{
if(month < 10)
{
return "0" + month;
}
else
{
return month;
}
}
function getDays(month, year)
{
var ar = new Array(12);
ar[0] = 31;
ar[1] = (leapYear(year)) ? 29 : 28;
ar[2] = 31;
ar[3] = 30;
ar[4] = 31;
ar[5] = 30;
ar[6] = 31;
ar[7] = 31;
ar[8] = 30;
ar[9] = 31;
ar[10] = 30;
ar[11] = 31;
return ar[month];
};
var ar = new Array(12);
ar[0] = "January";
ar[1] = "February";
ar[2] = "March";
ar[3] = "April";
ar[4] = "May";
ar[5] = "June";
ar[6] = "July";
ar[7] = "August";
ar[8] = "September";
ar[9] = "October";
ar[10] = "November";
ar[11] = "December";
function getMonthName(month)
{
return ar[month]
}
function setCal(mont, referenceObj, calendarDateFormat, calendarDateFieldSeperator, calendarBackColor, textBoxID)
{
var now = new Date();
var nmont=now.getMonth();
var nyear = now.getYear();
now.setDate(1);
now.setMonth((nmont+mont));
var year = now.getYear();
if (year < 1000)
year+=1900;
var month = now.getMonth();
var monthName = getMonthName(month);
var date = now.getDate();
now = null;
var firstDayInstance = new Date(year, month, 1);
var firstDay = firstDayInstance.getDay();
firstDayInstance = null;
var days = getDays(month, year);
return (drawCal(firstDay + 1, days, date, monthName, month, nmont, nyear, year, mont, month, referenceObj, calendarDateFormat, calendarDateFieldSeperator, calendarBackColor, textBoxID))
}
function drawCal(firstDay, lastDate, date, monthName, monthnum, nmont, nyear, year, mont, month, referenceObj, calendarDateFormat, calendarDateFieldSeperator, calendarBackColor, textBoxID)
{
var headerHeight = 4;
var border = 0;
var cellspacing = 0;
var headerColor = "#C93900";
var headerSize = "";
var colWidth = 0;
var dayCellHeight = 8;
var dayColor = "ffffff";
var cellHeight = 0;
// alert(calendarBackColor)
var todayColor = calendarBackColor;
var timeColor = "purple";
//var allmonths='
var allmonths='
for (i=0; i ![]()
{
allmonths=allmonths+'';
}
allmonths=allmonths+'';
var text = '';
text += '';text += '';
';
| |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| '; text += '
text += ' | |||||||||||
text += '';
return(text);
}
function tom(mont,referenceObj, calendarDateFormat, calendarDateFieldSeperator, calendarBackColor, textBoxID)
{
var screenHeight = screen.availHeight;
var screenWidth = screen.availWidth;
var objectPosX = findPosX(document.getElementById(referenceObj));
var objectPosY = findPosY(document.getElementById(referenceObj));
var objectWidth = document.getElementById(referenceObj).width;
if(!document.getElementById('iFrameCalendar'))
{
var objCalendar = document.createElement('');
document.body.appendChild(objCalendar);
}
calContainer = document.getElementById('iFrameCalendar');
calContainer.style.top = objectPosY + 'px';
calContainer.style.left = objectPosX + objectWidth + 'px';
calContainer.style.display = "block";
copyContent(setCal(mont, referenceObj, calendarDateFormat, calendarDateFieldSeperator, calendarBackColor,textBoxID));
calContainer.style.visibility = "visible";
}
function findPosX(obj)
{
var curleft = 0;
if (obj.offsetParent)
{
while (obj.offsetParent)
{
curleft += obj.offsetLeft;obj = obj.offsetParent;
}
}
else if (obj.x)curleft += obj.x;return curleft;
}
function findPosY(obj)
{
var curtop = 0;
if (obj.offsetParent)
{
while (obj.offsetParent)
{
curtop += obj.offsetTop;obj = obj.offsetParent;
}
}
else if (obj.y)curtop += obj.y;return curtop;
}
function copyContent(strContent)
{
var iFrameContent = "
%message%
"; var newContent = iFrameContent.replace(/\%message\%/, strContent);
var doc = getIFrameDoc();doc.open();doc.write(newContent);doc.close();
}
function getIFrameDoc()
{
var iFrame = document.getElementById("iFrameCalendar");
var doc = iFrame.contentDocument;
if (doc == undefined)doc = iFrame.contentWindow.document;
return doc;
}
height="14" src="../Resources/Images/icon_Cal.gif" width="12" align="absMiddle" />
4 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.

Afzaal Ahmad ZeeshanPosted Aug 26, 2015, 6:37 AM
Upendra Pratap ShahiPosted Aug 26, 2015, 6:03 AM
Subhani ShaikhPosted Aug 26, 2015, 5:57 AM
Afzaal Ahmad ZeeshanPosted Aug 26, 2015, 5:06 AM