• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

IE 6 problem with Dates?

 
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? >
 
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.
 
Author
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
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
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
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.
 
If you believe you can tell me what to think, I believe I can tell you where to go. Go read this tiny ad!
create, convert, edit or print DOC and DOCX in Java
https://products.aspose.com/words/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!