Crashes when display october, all browsers and years

I got scal crashing everytime I try to display the month of october, not only in my project, in all tests here too. Trying to get there walking thru months controls always ends up with a infinite loop like error, on FF, IE6 and IE7.

Got an idea? Tried to look upon the source but ain't got enough time yet, hope it's easy to fix, nice tool, the best on my opnion!

reason of the problem

The problem appear when the month to be shown croses a daylight saving change. The range generation which builds the month does not take into account the change in DST and so it never arrives to the upper date
In order to correct this I have to modify the succ() function in the Date object (inside scal.js). Here is the correct code (can be added at the end of scal.js):


Object.extend(Date.prototype, {
succ: function(){
var sd = new Date(0);
sd.setUTCFullYear(this.getUTCFullYear(),this.getUTCMonth(),this.getUTCDate()+1);
sd.setUTCHours(this.getUTCHours(),this.getUTCMinutes(),this.getUTCSeconds(),this.getUTCMilliseconds());
return sd;
}
});

Excellent..

Well, replace the code:

succ: function(){
var sd = new Date(this.getFullYear(),this.getMonth(),this.getDate()+1, 1);
sd.setHours(this.getHours(),this.getMinutes(),this.getSeconds(),this.getMilliseconds());
return sd;
},

and now everything is ok.

thanks.

Well, In October, duplicate

Well,

In October, duplicate day 11 :(

Date Error

jamiegrove's picture

Thanks for reporting back, Marcelo!

Problem October..

Well, I try on IE and Firefo 3, with scal-demo link and crash..
I´m using Prototype 1.6.0.2 and scal 0.2.

Thanks for great code.

Marcelo,

Correction from the October Crashes

Hi,

I was getting the same problem from Rafael Bandeira.

To make it works, just do it:

On line 12:

succ: function(){
var sd = new Date(this.getFullYear(),this.getMonth(),this.getDate()+1, 1);
sd.setHours(this.getHours(),this.getMinutes(),this.getSeconds(),this.getMilliseconds());
return sd;
},

On October, 12. Javascript not accept´s midnight.
So I just added one hour and it works.

I lost about 3 hours debugging the calendar on Visual Studio 2008.

Gustavo Morada

hey Jamie, I think you were

hey Jamie,
I think you were wrong, i'm tired of trying it out on diferent machines...

ie7,ie6,ff2,ff3 all of them crashed in all the machines, with diferent sets, hardwares, os (xp and vista)...

it goes to september fine, even on past year or in the current year... but when bumped to october, 'darn', the browse crashes on a infinit loop just as the ones I shoted the other day. It happens with online projects, local projects and hereby demos...

strange?... I wish i got some more time to get the code and figure it out as help... but no even for the report I got the time til now...

:/

cheers

just runned unittest... it

just runned unittest... it crashes too, and when it happens, the second calendar stops in the october month...

October Woes

jamiegrove's picture

Rafael,

Thanks for trying it out again. I still can't help but wonder if you have something different in the js includes or some other element that is causing trouble outside of scal. We test scal on OSX, XP, and Vista under every major browser version. After you reported your error, I went back and ran tests again on multiple platforms. No error.

Of course, I'm not saying that this isn't happening to you. :)

I'll keep checking here and if I find anything I'll post it. Feel free to send me an email and I'll notify you if I find a solution.

Thank you for your help.

- Jamie
jamiegrove@gmail.com

K, Jamie, thanks

K, Jamie, thanks again...

I'll put the source review on my schedule, if I figure something out i'll keep you in touch...

permission denied

you know i'm getting this terrible message:
Access denied
You are not authorized to access this page.

everytime i access : http://scal.fieldguidetoprogrammers.com/

and some other child pages... had to keep the bug-report forum as my scal favs root

Access denied fixed!

jamiegrove's picture

Thanks for alerting me to the error. Something kinda weird happened on Saturday night at midnight. I saved permissions and everything went back to normal. Very odd.

Problem outside scal/browser

jamiegrove's picture

Thanks for posting the screenshots, Rafael!

The problem shows up even when using scal on this site too? Well, I know we are using the right setup for prototype so we can eliminate that as the problem.

Since you replicated the problem with multiple browsers, it seems like there must be something outside the browser causing the problem. Do you run any malware/spyware detection software? What virus scanner do you use, and what options are turned on?

- Jamie

wow... heavy news... thought

wow... heavy news... thought it was a bit strange too... i got a ESET32 setted up here... i'll try on other machines and try to figure it out...

thanks for your attention i'll get the bug track updated as soon as I got something! []'s

http://picasaweb.google.com.b

http://picasaweb.google.com.br/rafaelbandeira3/ScalBugReport

there are the screenshots.... there's also a shot form the firebug console when prompted to debug the error, but I'm not sure it's somehow expressive...

k, regards, waiting on you analysis now! :P

ps.. oh the boxes are in pt-br cuz i'm brazilian... (okdok)

Hey, sorry for the delayed

Hey, sorry for the delayed response...

hum... it still messes up with me... just got a screenshot, on "october 2008", it just crashes and Firefox asks for script debugging or stop it at all, the same result is repeated on IE's.

I'm using Prototype={Version:"1.6.0" compressed, but it was bugging me when I used the uncompressed version too...

Funny though you are not having th same problem. I'll be back soon with a flickr link of the screenshot.
til there, thanks for the real good piece of code!

Red October :)

jamiegrove's picture

Hmmm. I couldn't duplicate this using the scal demo on the site:

http://scal.fieldguidetoprogrammers.com/scal-v02-documentation/scal-demo

Which version of prototype are you using?

Thanks!

- Jamie

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options