Wicket
  1. Wicket
  2. WICKET-5204

The DateTimeField.onBeforeRender() method does not format the fields correctly.

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.9, 6.7.0, 6.8.0
    • Fix Version/s: 6.9.0, 1.5.11, 7.0.0-M1
    • Component/s: wicket-datetime
    • Labels:
      None

      Description

      The current implementation relies on the org.joda.time.MutableDateTime instance to format the date, hours, amOrPm, and minutes fields. Unfortunately, the MutableDateTime constructor is not provided with the client's TimeZone value (assuming it is set). As a result, the joda library uses the JVM's default timezone. If the defaul timezone differs from the client's timezone, the formatted fields may turn out to be incorrect.

        Activity

        Hide
        Caleb Powell added a comment -

        This unit test demonstrates the problem; it sets the default timezone to UTC, and then creates a DateTimeField component with a client timezone of 'America/Toronto'. The formatted time does not meet the expectation.

        Show
        Caleb Powell added a comment - This unit test demonstrates the problem; it sets the default timezone to UTC, and then creates a DateTimeField component with a client timezone of 'America/Toronto'. The formatted time does not meet the expectation.

          People

          • Assignee:
            Martin Grigorov
            Reporter:
            Caleb Powell
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development