Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-31291

2-digit year on Jira Date Picker converted to 1900 if 20 years or more in the future

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Medium
    • None
    • 5.2.4.1, 6.3.15, 6.4.11, 7.13.1, 8.2.4, 8.5.6, 8.13.1, 8.21.0, 9.10.0, 9.12.7
    • Issue - Fields

    Description

      NOTE: This bug report is for JIRA Server. Using JIRA Cloud? See the corresponding bug report.

      Summary

      By default Jira ships with settings to accept only 2 digits for year values in dates. This causes ambiguity for dates of events that are several years in the future or past because of the inherit loss of precision that comes with trying to store a four digit value like a year with only two digits.

       

      Steps to reproduce:

      1. Create or edit an issue and set the Due Date to 01/Jan/2044 or any date after that. This threshold date increases every year. On 2025 the new threshold will be 01/Jan/2045.

      Expected behavior:

      Jira should set the correct date.

      Actual results:

      You pick a date after 01/Jan/2044 it will yield a date from early 1900's.

      For example, picking 02/Mar/2044 yields 02/Mar/1944 when the field is saved.

      Workaround:

      A Jira Administrator can change the input settings and the look and feel setting so that all dates in Jira will always use 4 digit years instead of 2 digit years. This will help to avoid the problem when users are setting values going forward.

      1. ⚙︎ -> System -> General configuration -> Advanced settings:

      Change 4 values on this page

      1. jira.date.picker.java.format
      2. jira.date.picker.javascript.format
      3. jira.date.time.picker.java.format
      4. jira.date.time.picker.javascript.format

      For the java fields change the 'yy' portion to 'yyyy'. For the javascript entries, the syntax is different, you have change '%y' to '%Y'.   So for example if jira.date.picker.java.format has a current value of 'd/MMM/yy' (without quotes) you would change this to 'd/MMM/yyyy'.

      2. ⚙︎ -> System -> User Interface -> Look and Feel


      The look and feels settings also need to be updated. Change the year values here from 'yy' to be 'yyyy'.

      Attachments

        1. advancedset1.png
          832 kB
          Andy Heinzer
        2. lookfeel1.png
          175 kB
          Andy Heinzer
        3. Screen Shot 2017-10-30 at 12.12.03 PM.png
          43 kB
          Erica Larson
        4. Screenshot 2020-12-18 at 16.17.32.png
          98 kB
          Przemyslaw Czuj

        Issue Links

          Activity

            People

              Unassigned Unassigned
              pcora Pedro Cora
              Votes:
              75 Vote for this issue
              Watchers:
              73 Start watching this issue

              Dates

                Created:
                Updated: