If you look at some of the files in the
com.google.gwt.user.datepicker.client[1], you'll see that the gwt
developers themselves are freely using these deprecated java.util.Date
methods.
To avoid the java warnings, they put a @SuppressWarnings() at the head
of any method that uses them (or sometimes the entire class)
@SuppressWarnings(/* Required to use Date API in gwt */
{"deprecation"})
I think the argument here is that the GWT implementation of
java.util.Date is based on the JavaScript Date object, and therefore
it's OK to use those methods.
You still have to be wary of timezone issues, though. For example:
Date today = new Date();
Window.alert(today.getHour());
...will show different values if you are in Amsterdam or in Mexico
City.
Erik
[1]
http://google-web-toolkit.googlecode.com/svn/trunk/user/src/com/google/gwt/user/datepicker/client/
On May 17, 1:57 am, aditya sanas <[email protected]> wrote:
> Ignore deprecation warning
> u have only one option on client side i.e. Date() object from java.util
> so user getYear(),getMonth() etc. methods for getting hrs minutes secs and
> year
> --
> Aditya
>
>
>
> On Mon, May 17, 2010 at 12:20 PM, Sabbir <[email protected]> wrote:
> > and how about reading the years, months, day, hour, minutes and
> > seconds from the date object?
>
> > On May 15, 6:13 am, Sabbir <[email protected]> wrote:
> > > the methods inDateobjecat as getTime, getHour, etc are deprecated
> > > ones.
> > > And in GWT calendarobjectis not allowed.
>
> > > so how do set thedateobjectin GWT???
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > "Google Web Toolkit" group.
> > > To post to this group, send email to [email protected]
> > .
> > > To unsubscribe from this group, send email to
> > [email protected]<google-web-toolkit%[email protected]>
> > .
> > > For more options, visit this group athttp://
> > groups.google.com/group/google-web-toolkit?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google Web Toolkit" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected]<google-web-toolkit%[email protected]>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-web-toolkit?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group
> athttp://groups.google.com/group/google-web-toolkit?hl=en.
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.