Manually entering a date with a two-digit year results in a negative epoch time in the database when system date settings are set to 4-digit years

XMLWordPrintable

    • 7.06
    • 1
    • Severity 3 - Minor

      Issue Summary

      When a date is entered by a date picker is then updated manually in the date field to only include 2-digit year, this date is stored as a negative epoch in the database.
      One example of a date is a sprint start date.

      Steps to Reproduce

      1. Go to the system advance settings.
      2. Change jira.date.picker.java.format to d/MMM/yyyy
      3. Change jira.date.picker.javascript.format to %e/%b/%Y
      4. Change jira.date.time.picker.java.format to dd/MMM/yyyy h:mm a
      5. Change jira.date.time.picker.javascript.format to %e/%b/%Y %I:%M %p
      6. Start a sprint with a custom duration
      7. Pick a date
      8. Update the date filled by the date picked to only include two digits in the year. For instance, from 28/Mar/2019 04:37 PM to 28/Mar/19 04:37 PM.
      9. Start the sprint

      Expected Results

      The sprint start date in the DB should be stored as if it was in the year 2019.

      Actual Results

      The sprint start date in the DB is stored as if the sprint started in the year 0019. Thus, it's a negative epoch.

      # SELECT * FROM "AO_60DB71_SPRINT" WHERE "NAME"='Sample Sprint 4';
       CLOSED | COMPLETE_DATE |    END_DATE     | GOAL | ID |      NAME       | RAPID_VIEW_ID | SEQUENCE | STARTED |   START_DATE
      --------+---------------+-----------------+------+----+-----------------+---------------+----------+---------+-----------------
       t      | 1553009870350 | -61559771220000 |      |  9 | Sample Sprint 4 |             3 |          | t       | -61561067201237
      (1 row)
      

      Notes

      • This bug breaks reporting done by add-ons such as eazyBI.
      • If possible, Jira should enforce the choice of a 4-digit year in the front end.

        Workaround

        The data needs to be fixed manually in the database.

            Assignee:
            Unassigned
            Reporter:
            Arbi Dridi
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: