Thanks,
Sanjiv
In which case, I don't think so. Though in theory I guess it could be
turned into that. Not sure if it's worth the effort. A simple test
should suffice to figure this out if it's important to you.
If you were inquiring as to whether or not you can use it at all,
insert same incredulous "whatever makes you think it wouldn't? It's in
java.util.* and as a rule stuff in there is supported" reply in the
vein of Bernard's.
On May 29, 3:12 am, "Bernard Choi" <bch...@gmail.com> wrote:
> Greetings,
>
> java.util.Date is covered by the JRE emulation library. (http://code.google.com/webtoolkit/documentation/java.util.html
> ) It should be supported. Where is this Language Support section that you
> are referring to ?
>
I noticed many posts on this over time. Take a look; I'm sure you can
find more information.
I tried passing a Date across boundaries and got a NPE. I think it
would be very useful if GWT supported this. I was sorta expecting this
to work since there's a corresponding data type in each language. I am
using a calendar JS widget which returns a Date object. The widget
supports different formatting options but its API returns a Date
object. So in the absence of support of Date's across Java - JSNI, I
cannot retrieve the selection as a Date object and the String
representation of the date is not as useful as it could be formatted
for display differently.
I hope this makes sense.. support for Date's would definitely make the
JSNI API "less surprising".
Thanks,
Sanjiv
The only issue is granularity range. Where in java longs go into a
couple million years BC and AD, in javascript, because they are
secretly all doubles, they conk out at 30,000 AD or so. I mean, year
2k was a flub and all, but at the moment I'm not too worried about
apps that start skipping a couple of milliseconds about 30 thousand
years in the future :-P
I'm in tentative agreement that it would be nicer if they were bridged
automatically, and if you want you can take this up as an issue in the
issuetracker, but I suspect you'll have to provide the patch yourself
if you want any chance of this making it into GWT.
The bridge would probably be a few more lines of boilerplate code
since JSNI doesn't support constructing a new Java object directly
(Issue 623). I'll probably toss in another factory method or chain two
method calls.
Thanks,
Sanjiv