Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-27022

"Current date adjusted" default field value fails due to DST

    XMLWordPrintable

Details

    Description

      https://jira.ez.no/browse/EZP-26791 introduced a timestring (like "now", or "1 day, 2 hours") as the way to delay the initialisation of the datetime value until when you're creating it, rather than when the content type cache was last cleared (which was the bug).

      This fails for DEFAULT_CURRENT_DATE_ADJUSTED because the adjustment is calculated by taking current time, adding the DateInterval, and comparing the resulting time with the original as timestamps, before making a timestring out of it. But timestamps do not care about DST (daylight savings time), so this will in some cases lead to off-by-one-hour bugs.

      The fix is to instead format the timestring as containing all the properties of the DateInterval (years, months, days, hours, minutes, seconds, whether they are zero or not). By not translating to timestamps we avoid the bug.

      Attachments

        Activity

          People

            Unassigned Unassigned
            gunnstein.lye@ibexa.co Gunnstein Lye
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 30 minutes
                2h 30m