On 3 juil, 01:16, rxin <reyno...@gmail.com> wrote:
> I have a JSNI function that returns a JavaScript Date object. I want
> to return as a Java Date class, but keeps getting ClassCastException.
> How exactly should I change my code?

return the date's "timestamp" as a double and then create a Java Date
from it.

public Date getVisibleChartStartDate(JavaScriptObject jso) {
   return new Date((long) getVisibleChartStartDateImpl(jso));
}

private native double getVisibleChartStartDate(JavaScriptObject jso) /
*-{
   return jso.getVisibleChartRange().start.getTime();
}-*/;

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to