Uploaded image for project: 'MyFaces Trinidad'
  1. MyFaces Trinidad
  2. TRINIDAD-748

Client-side DateTimeRangeValidator does not handle differences in timezone

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.2.2-core
    • 1.0.5-core, 1.2.4-core
    • Components
    • None

    Description

      Scenario: I'm using a DateTimeRangeValidator on an inputDate, with minimum bound to a Date, say, since today at midnight (Oct 1 2007 12:00:00 AM). The server is running in local time (Pacific/Los_Angeles). The client is running in America/New_York timezone.

      If client-side validation is disabled, the user can enter a string like "Oct 1 2007 12:00:01 AM" and that will submit successfully since the string is interpreted into the server's timezone and it is indeed greater than today's midnight.

      If client-side validation is enabled, the same string will fail. The error message is "Enter a date greater than or equal to Oct 1 2007 3:00:00 AM". This is because the client-side validator is interpreting the value in the local timezone, so "Oct 1 2007 12:00:01 AM EST". That is earlier than "Oct 1 2007 12:00:00 AM PDT", so it fails validation.

      The net result is, the values accepted are dependent on client-side validation being enabled, and whether the timezone adds/subtracts from the value so that it still falls within range.

      Attachments

        1. Trinidad11_748.patch
          20 kB
          Yee-Wah Lee

        Activity

          People

            matzew Matthias Wessendorf
            yeelee Yee-Wah Lee
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: