Hi all,
I'm experiencing the same issue using GWT 1.7. Browsers tested:
Firefox 3.5.3 (Mac OSX), Safari 4 (Mac OSX), Firefox 3.0 (Linux).
I haven't tested the java.util.Date.compareTo(Date) output directly, I
simply found that the result of Collections.sort(List<MyBean>,
Comparator<MyBean>) is not correct if the comparator delegates the
return value to Date.compareTo(Date).
The result becomes correct if I replace the Date.compareTo(Date)
statement with a logically equivalent code snippet which uses
Date.getTime().
Regards,
Marco
On 25 Ago, 22:32, Thomas Broyer <
t.bro...@gmail.com> wrote:
> On 25 août, 16:52, pipo <
marchais.nico...@gmail.com> wrote:
>
> > it seems the method Date.compareTo(Date myDate) does not work with the
> > compiled version on GWT client side code but work perfectly in Web
> > Hosted mode.
>
> That's because hosted mode uses the pure-Java Date while web mode
> ("compiled version") uses a JavaScript emulation.
>
> > Is it normal or is it a bug?
>
> It isn't normal, but compareTo looks fine:
http://code.google.com/p/google-web-toolkit/source/browse/releases/1....
> ...and further mode it is unit-tested:
http://code.google.com/p/google-web-toolkit/source/browse/releases/1....