Popup Calendar Localisation

With the introduction of IE7 an error in the use of the DotNetNuke pop-up calendar control was introduced.

Dates entered in the popup calendar are rendered in American format (mm/dd/yyyy) rather than the localised version, English (dd/mm/yyyy).

Looking at the calendar code /js/PopupCalendar.js. The line at issue is the setting of the anchorval in the function calPopupSetData.

if(((weekDay+7-popCalFirstDayWeek)%7 != calDay) || (monthDate > lastDate))
{
   popCalData+=("<TD width=\"35\">"+fnt[1]+" </FONT></TD>");
continue;
}
else
{
anchorVal = "<A HREF= \"javascript:window.opener.calPopupSetDate(window.opener.popCalDstFld,'" + (thisMonth+1) + "/" + monthDate + "/" + thisYear + "');
window.opener.closeCalPopup()\">";
jsVal = "javascript:window.opener.calPopupSetDate(window.opener.popCalDstFld,'" + constructDate(monthDate,thisMonth+1,thisYear) + "');
window.opener.closeCalPopup()";popCalData += ("<TD width= \"35\" "+cellAttribs+"onClick=\""+jsVal+"\">");
if ((firstDay.getMonth() == dtToday.getMonth()) && (monthDate == dtToday.getDate()) && (thisYear == dtToday.getFullYear()) )
popCalData += (anchorVal+fnt[2]+monthDate+"");
else
popCalData += (anchorVal+fnt[1]+monthDate+"");weekDay++;
monthDate++;
}

The updated anchorval line is:

anchorVal = “<A HREF=\” window.opener.calPopupSetDate(window.opener.popCalDstFld,'” + constructDate(monthDate,thisMonth+1,thisYear) + “‘);window.opener.closeCalPopup()”

As always before making changes its worth having a backup of the original version, in particular and probably for good measure the complete website.