jsCalendar - Stack Overflow (v8)

Postby paul.basher » Sat Feb 12, 2011 9:03 pm

Hi
I have just installed version 8 and I am working with a project crated in version 7
When using the jsCalendar extension to input a date field this works fine except when tring this to add a new record in the new Grid Add Master detail option
In this mode the calendar does not exit the screenm when a date is selected.
In Google Chrom nothin happens
In Internet Explorer 8 I get a stack overflow error at line 1879 error message
Please can you advise
Thanks, Paul
paul.basher

Re: jsCalendar - Stack Overflow (v8)

Postby Webmaster » Tue Feb 15, 2011 10:27 am

The jsCalendar modify the JavaScript Date object , but the calendar.js cannot be included more than once or it will repeatedly set up the Date object.

You can fix the calendar.js as follows:

if (!Date.prototype.__msh_oldSetFullYear) { // add this line
Date.prototype.__msh_oldSetFullYear = Date.prototype.setFullYear;
Date.prototype.setFullYear = function(y) {
var d = new Date(this);
d.__msh_oldSetFullYear(y);
if (d.getMonth() != this.getMonth())
this.setDate(28);
this.__msh_oldSetFullYear(y);
};
} // add this line

또는

if (!Date.prototype.__msh_oldSetFullYear) { // add this line 내가 전에 했을 땐 이 부분이 잘 됬다.
Date.prototype.__msh_oldSetFullYear = Date.prototype.setFullYear;
} // add this line
Date.prototype.setFullYear = function(y) {
var d = new Date(this);
d.__msh_oldSetFullYear(y);
if (d.getMonth() != this.getMonth())
this.setDate(28);
this.__msh_oldSetFullYear(y);
};



Webmaster
Posts: 18139
Joined: Fri Aug 06, 2004 5:59 pm
Location: http://www.hkvstore.com/

Re: jsCalendar - Stack Overflow (v8)

Postby paul.basher » Wed Feb 16, 2011 6:16 am

Thanks, I have amended as you described and everything works fine

'J > Javascript' 카테고리의 다른 글

클로져 활용법  (0) 2014.03.18
javascript arguments를 array로 변환하기  (0) 2014.03.16
JavaScript - Prototype's delay() Function  (0) 2014.03.16
javascript 파일 저장하기  (0) 2012.12.25
섹시한 자바스크립트 코딩 컨벤션  (0) 2012.03.02

설정

트랙백

댓글