Announcement

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

    Time Issue with DataSourceDateTimeField and Time

    I have a ListGrid that has a few fields that show incorrect times.
    In the ListGrid I see some showing correctly and some don't but no idea
    what would cause that issue, when data is sent to the backend for saving it's correct it just shows incorrectly.

    Database date(is whatever) and time is 00:00:00 but view shows the column value as 01:00:00 on some records and correctly on others.

    GWT 2.0.3
    SmartGWT 2.1
    Database : MySQL (on local machine)
    OS : Win7 64bit

    Code:
    DataSourceDateTimeField dateTimeField = new DataSourceDateTimeField("effdattim");
    dateTimeField.setTitle("Effective Date-Time");
    dateTimeField.setCanEdit(true);
    addField(dateTimeField);

    #2
    Well, very basic question - how are you fetching data - what kind of DataSource?

    Comment


      #3
      I'm using RPC via the GWTRPCDataSource which extends com.smartgwt.client.data.DataSource

      Comment


        #4
        That's too bad, that's not what we recommend. With Pro or better of course this issue does not occur.

        There's lots of possible problems - you need to log the value of the date objects involved at each level from the database to the browser, mindful of the timezone in use at each point.

        Comment


          #5
          I've gone through and printed out the time in milli as well as the offset, they all seem to be the same

          I've included an image of the ListGrid row view and the Database data.

          Time in RPC Server side: 1265004000000
          Offset Server side: 360


          GWTRPCDatasource: 1265004000000
          Offset in GWTRPCDatasource: 360


          copyValues from Rec to DataSource : 1265004000000
          Offset in DataSource: 360


          Thank your for your help
          Attached Files

          Comment


            #6
            You mentioned it's intermittent. Are the values you've logged from one of the time when the date is display wrongly?

            Comment


              #7
              Further clarification - logical dates (dates with no meaningful time value, like the date of a holiday) are represented as zero seconds past midnight in browser local time.

              This is all automatic with Pro - you should upgrade as soon as possible.

              Comment


                #8
                Originally posted by Isomorphic
                You mentioned it's intermittent. Are the values you've logged from one of the time when the date is display wrongly?
                Yes that was one that was incorrectly displayed.

                Comment

                Working...
                X