Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-25594

Fix timezone handling in Date widget

    XMLWordPrintable

    Details

      Description

      The date displayed by the Date widget when a default time is set is not correct: the shift which corresponds to the user timezone is not understandable. Here is an example:

      Pre-requisites:

      • Set the Timezone on your computer to PST
         export TZ='America/Phoenix'

        You will use the console with this environment variable to start Nuxeo

      Steps to reproduce:

      1. Define a Date field
      2. In the corresponding JSF layout, use a datetime widget configured as below
              <widget name="mydate" type="datetime">
                <labels>
                  <label mode="any">Mydate</label>
                </labels>
                <translated>false</translated>
                <fields>
                  <field>schema:mydate</field>
                </fields>
                <properties widgetMode="edit">
                  <property name="format">yyyy-MM-dd HH:mm</property>
                  <property name="timeZone">UTC</property>
                  <property name="defaultTime">05:00</property>
                </properties>
              </widget>
        
      • Load this configuration
      • Create a document which contains this Date field
      • Click on the Calendar and select a date, for example August 15th
      • Observe that the date displayed in the field is
        2018-08-15 22:00

      => the hour corresponds to the defaultTime value minus the PST Timezone (7h) BUT the day is the same, whereas August 15th 5:00 AM should correspond to August 14th 10:00PM

      Expected result: the date displayed should correspond to the selection

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              tmartins Thierry Martins
              Participants:
            • Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: