Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Date manipulation

    Hi,

    We are using SmartGWT Pro 3.0 version. As we cannot use java.util.Calender in smartGWT what is the alternative of that, I want to do some date manipulation e.g. add one month in current date etc.

    Thanks

    #2
    There's no direct equivalent of Calendar. If you want a richer API than java.util.Date, there are several third-party Date manipulation libraries available for GWT. We don't have a particular one we've used or would recommend, so you'll need to Google for details.

    Comment


      #3
      Could you use java.util.Calendar via DMI ?

      Comment


        #4
        You might want to check-out Joda-Time, which has a Java library:
        http://joda-time.sourceforge.net/

        And a couple GWT ports, though I do not know which one to use:
        http://code.google.com/p/gwt-time/
        http://code.google.com/p/gwt-joda-time/

        For basic operations, com.google.gwt.user.datepicker.client.CalendarUtil might be good enough:
        http://google-web-toolkit.googlecode...endarUtil.html

        It seems to me that gwt support for date/time/timezone manipulation is generally very limited, so hitting the server every time might be the best way to go, especially for consistent behavior in date calcs, and so that you do not have to represent the timezone on the client.
        This is even better if you have an optimized RPC mechanism such as a command-pattern that can group sequential or steady requests into a single server hit...

        Comment

        Working...
        X