File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes IE 6 problem with Dates? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "IE 6 problem with Dates?" Watch "IE 6 problem with Dates?" New topic
Author

IE 6 problem with Dates?

Nick Potter
Ranch Hand

Joined: May 07, 2008
Posts: 126
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

Joined: Sep 01, 2005
Posts: 182
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

Joined: Sep 29, 2008
Posts: 12617

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

Joined: May 07, 2008
Posts: 126
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

Joined: Sep 29, 2008
Posts: 12617

What's the browser sending???
Nick Potter
Ranch Hand

Joined: May 07, 2008
Posts: 126
01/Oct/2009 00:00:00

30/Sep/2009 00:00:00
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

With both browsers?

In that case it's an issue with your Ajax.
Nick Potter
Ranch Hand

Joined: May 07, 2008
Posts: 126
Here is the Ajax call:

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

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

Joined: May 07, 2008
Posts: 126
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: IE 6 problem with Dates?
 
Similar Threads
Date difference
Change value in form onClick
dates between two dates
Comapring dates in hibernate
JAVA...using a SQL Statement