Announcement

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

    JSon Date: millisecond is omitted from Smartclient server serving IE

    Our application requires the precision down to millisecond and the server is providing so to the client. I have modified the formatter on the client side to correctly display it from a JS Date value. On Chrome and FF this is all working correctly (see the screenshot from Chome debug tool of network traffic received); but IE 9 ignores this portion somewhere on the server side (see screenshot). Since our application is insensitive to the browser technology I suspect it has to be smartclient server that is cutting off the milliseconds.

    I am using version 8.3p Jan 29th.

    Thanks
    Attached Files

    #2
    I want to follow up on a different aspect of this issue. When part of filter criteria (of a listgrid) is a Date (datetime type) with milliseconds the serialization into Xml ignored the millisecond portion. I found the problem in toSchemaDate() and overrode it by adding to the end:
    Code:
       toSchemaDate : function (logicalType) {
           // logical date values have no meaningful time
           // Note that they also have "no meaningful timezone" - we display native browser locale time
           // to the user and when we serialize to send to the server we serialize in that same
           // local timezone.
           if ((logicalType == "date") || this.logicalDate) {
               return isc.SB.concat(
                   this.getFullYear().stringify(4),
                   "-",
                   (this.getMonth() + 1).stringify(2),     // getMonth() is zero-based
                   "-",
                   this.getDate().stringify(2)
               );
           };
    
           // logical times are serialized as truncated schema strings (HH:MM:SS) by default
           if ((!isc.DataSource || !isc.DataSource.serializeTimeAsDatetime) &&
               (logicalType == "time" || this.logicalTime))
           {
               return isc.SB.concat(
                   this.getHours().stringify(2), ":",
                   this.getMinutes().stringify(2), ":",
                   this.getSeconds().stringify(2)
               );
           }
    
           // represent date time values in UTC
           return isc.SB.concat(
                   this.getUTCFullYear().stringify(4),
                   "-",
                   (this.getUTCMonth() + 1).stringify(2),     // getMonth() is zero-based
                   "-",
                   this.getUTCDate().stringify(2),
                   "T",
                   this.getUTCHours().stringify(2),
                   ":",
                   this.getUTCMinutes().stringify(2),
                   ":",
                   this.getUTCSeconds().stringify(2),
                   ".",
                   this.getUTCMilliseconds().stringify(3)
           );
       },
    Now the serialization is corrected with milliseconds coded as ".000" after seconds. However, server-side smartclient does not seem to be able to parse it.

    I think this is a serious problem as many scientific application do require the precision to millisecond, not only to display but also to actually use it.

    Comment


      #3
      Can I get some answer regarding these two questions? We do have purchased support and need to make decision on our own behalf.

      Thanks

      Comment


        #4
        We are currently looking at this - it does make sense as a possible enhancement, however, it's not a trivial matter because introducing support for millisecond precision could affect existing applications that aren't expecting it.

        Anything that happens here will be for 9.1 or later only, so you should start on your migration if you need this feature.

        Comment


          #5
          We have added support for preserving the millisecond element of times and datetimes across server roundtrips, together with an option to switch that off if necessary, and documented strategies for each of the built-in DataSource types for preserving the milliseconds all the way to/from the database (scan the DataSource docs for "trimMilliseconds"). This support is in 9.1d only, as of tomorrow's nightly build.

          Comment

          Working...
          X