Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

IE 6 problem with Dates?

 
Nick Potter
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a strange issue while comparing dates. I have startDate and endDate and I'm trying to do a validation on them, startDate<endDate. if startDate is 1 Oct and endDate is 30 Sep this validation doesn't work in IE 6, but in Mozilla it's ok. I'm using an ajax call for this. Does anyone have any idea what's this? >
 
Fatih Keles
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How are the request parameters (dates) are passed to your servlet? Do you parse these parameters to java.util.Date objects when comparing? Some little piece of code may provide you to get answers more easily.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're doing the comparison on the server side the browser is irrelevant; as the previous comment said check what you're sending.
 
Nick Potter
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the code...




These are the sysouts:
01/Oct/2009 00:00:00
30/Sep/2009 00:00:00
1254391143703
1256554743703
1254304743703


What's really puzzling me is that it works in Mozilla, but not in IE 6...

Works in IE 7, too... what's the issue with IE 6?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's the browser sending???
 
Nick Potter
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
01/Oct/2009 00:00:00

30/Sep/2009 00:00:00
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With both browsers?

In that case it's an issue with your Ajax.
 
Nick Potter
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is the Ajax call:

 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you considered using a library that abstracts away browser differences? Yuck!

Have you debugged the JavaScript? Have you checked the wire to see what's actually being sent/received?
 
Nick Potter
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, i've considered using a library (jQuery), yet time is very limited for learning . Anyway, i fixed the code by replacing the above ajax call with a jQuery one. Thanks for the input.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic