Announcement

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

    Feature request: Jodatime support

    It would be ooooh so sweet if we could just return beans that have fields that are jodatime classes (datetime, localtime etc), and it would work.

    As it is, we have to catch everywhere, do cumbersome converting to Date objects etc.

    Jodatime is arguably the go-to framework work working with dates, times, etc. so it would be great if you'd support it.


    EDIT: please note that i'm talking about server side code, not gwt stuff.
    Last edited by mathias; 6 Apr 2014, 03:09.

    #2
    Hi mathias,

    JodaTime is a Java API. You'd need a JS version as well as a wrapper (pretty much the same that is SmartGWT to SmartClient).

    Reading http://stackoverflow.com/questions/1...ibrary-for-gwt it seems that these don't exist/are actively worked on, although I did not try myself.

    I think that there will be improvements once GWT supports Java8 JSR 310/Date and Time API, which might take some time according to https://code.google.com/p/google-web.../detail?id=603.

    Right now, from my understanding, there is nothing Isomorphic can do about this.

    Best regards,
    Blama

    Comment


      #3
      Hello Blama,

      thanks for chipping in. Let me elaborate a bit.

      I'm not looking to utilize JodaTime classes in my client code. (although that'd be neat as well!)

      I want to be able to use it server-side, in my JPA beans and Spring services and return those in my DSResponses without the SmartGWT *server side* code crashing.

      Example:

      say i have a java bean with a column like this:

      Code:
      @Column(name = "whstart", nullable = true)
          @Type(type = "org.joda.time.contrib.hibernate.PersistentLocalTimeAsString")
          LocalTime whstart;
      Right now, this causes SmartGWT to crash when a bean with such a column is used as data in a dsresponse, because smartgwt can't convert it to data to be sent to the client. I get errors like:

      Code:
      java.lang.IllegalAccessException: Class com.isomorphic.util.DataTools can not access a member of class org.joda.time.DateTimeFieldType$StandardDateTimeFieldType with modifiers
      This is really unfortunate, since it forces me to create special javabeans, convert back and forth between jodatime and java dates just for SmartGWT to be able to send the stuff to the client.

      Comment

      Working...
      X