Announcement

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

    some of the DateDisplayFormat values not working

    (using SmartClient 8.3 eval)

    I have a ListGrid with a datetime column. Each of these work exactly as shown in the documentation:

    Date.setShortDatetimeDisplayFormat("toDateStamp");
    Date.setShortDatetimeDisplayFormat("toLocaleString");
    Date.setShortDatetimeDisplayFormat("toUSShortDate");
    Date.setShortDatetimeDisplayFormat("toUSShortDatetime");

    However, when I use "toSerializeableDate", it displays the date as "YYYY-MM-DD"

    I need it to work as shown in the documentation: "YYYY-MM-DD HH:MM:SS"

    Am I doing something wrong ??

    #2
    I hacked a fix for now...

    Unless someone can tell me how to get it working as explained in the documentation, I did this for now:
    Code:
       function stringPadLeading(string, padCharacter, length) {
          return String(padCharacter + string).slice(-length);
       };
    
       function dateTimeFormatter() {
          return this.getFullYear() + "-" +
                  stringPadLeading(this.getMonth(), "0", 2) + "-" +
                  stringPadLeading(this.getDate(), "0", 2) + " " +
                  stringPadLeading(this.getHours(), "0", 2) + ":" +
                  stringPadLeading(this.getMinutes(), "0", 2) + ":" +
                  stringPadLeading(this.getSeconds(), "0", 2);
       };
    
       Date.setShortDatetimeDisplayFormat(dateTimeFormatter);

    Comment


      #3
      Thanks for the report - this has been fixed in 8.3 and 9.0 - please retest with a build dated March 12 or later

      Comment

      Working...
      X