Add some validator and warning message in UI when a user enters only 2 digits of the year in format dd/MM/yyyy

XMLWordPrintable

    • 1
    • 17

      Problem

      Add some validator and warning message in JIRA when a user enters a date (year part) using dd/MM/yy, while the input date format is set to dd/MM/yyyy

      Steps to Reproduce:

      1. Go to Administration > General Configuration > Advanced.
      2. Change the jira.date.picker.java.format from d/MMM/yy to dd/MM/yyyy.
      3. Create or edit an issue and type a number date in the Due Date field with format d/m/yy such as 1/1/14 for example
      4. Then click create or edit.
      5. After it is created or updated, go to the issue and click edit.

      Actual Results:

      The date typed is accepted and the Due Date field is storing 01/01/0014 instead of 2014.

      Suggestion

      Add some validator and warning message in JIRA UI when a user enters a date using dd/MM/yy, while the input date format is set to dd/MM/yyyy, so that the wrong year does not get set in JIRA.

      Notes

      It was decided in this original bug ticket that this behavior was actually not a bug, but an expected behavior due to the following reason:

      For parsing, if the number of pattern letters is more than 2, the year is interpreted literally, regardless of the number of digits. So using the pattern "MM/dd/yyyy", "01/11/12" parses to Jan 11, 12 A.D.
      

      source:

      Having said that, in order to avoid any confusion for JIRA users, it would be great to do a check on JIRA side on the input data before the date gets processed in the backend by the Java class.

            Assignee:
            Unassigned
            Reporter:
            Julien Rey (Inactive)
            Votes:
            14 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated: