Announcement

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

    Displaying Time Item value as HH:MM

    Hi,

    We are using SmartGWT Pro 3.0 version.

    We have to display the Time as 2 digit Hour and 2 digit Minutes (HH:MM).

    we have set the time item the timeDisplayFormat as follows:

    TimeItem timeItem = new TimeItem(name, title);
    timeItem.setType("time"); timeItem.setDisplayFormat(TimeDisplayFormat.TOSHORTPADDED24HOURTIME);

    But it still display the Time in the formate [H] H:MM. ie it takes first Hour digit as Optional. We need to display it atleast as Zero.

    Thanks in Advance.

    #2
    If it's very important to show a leading 0 for single-digit hours, you will need to add your own formatter.

    Comment


      #3
      How can i create a new custom TimeDisplayFormat. Please give me some sample codes.

      Thanks

      Comment


        #4
        Hi,

        As the Documentation TimeDisplayFormat.TOSHORTPADDED24HOURTIME is not working properly. it shows as 3:16 and not as 03:16.

        Is there any other change to done for this behavior.

        Thanks
        Last edited by fairoz172; 16 Jan 2013, 20:45.

        Comment


          #5
          We've reproduced the problem, which only seems to affect the function TimeItem.setDisplayFormat(). We're investigating, but in the mean time you can switch to using TimeItem.setTimeFormatter() if you wish which seems to work and takes the same argument.

          Comment

          Working...
          X