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

Datepicker month parsing is broken

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Low
    • None
    • 3.8.1
    • None

    Description

      The problem is with the following parsing method in calendar.jsp:

      Date.parseDate = function(str, fmt) {
      ...
      	var a = str.split(/\W+/);
      ...
      

      Problem is that \W does not recognize characters such as á, ä, č, ď, é, í, ĺ, ľ, ń, ó, ô, ŕ, ř, š, ť, ú, ý, ž, etc. as valid characters for words and treats them as characters that separate words, hence the date string such as "19/máj/05" (19/May/2005) is split into ["19", "m", "j", "05"].

      Under normal circumstances, parsing should result in ["19", "máj", "05"] array, which can be mapped as

      parsed mapped to  
      19 19  
      máj 5 5th month in the array is _máj
      2005 2005  

      However, incorrect parsing continues and causes incorrect mapping:

      parsed mapped to  
      19 19  
      m 3 finds first moth starting with m, which is marec
      j 2007 (defaults to year of today's date
      05   ignored

      As an end result 19/May/2005 pops up in the calendar as 19/Mar/2007.

      This was replicated when looking at JRA-8703. Run JIRA with Slovak (Slovakia) as default language (Admin -> General Configuration) or -Duser.language=SK from command line.

      I am not sure what is the best way of fixing this.

      Attachments

        1. datepicker.jpg
          24 kB
          Dushan Hanuska [Atlassian]

        Issue Links

          Activity

            People

              dushan@atlassian.com Dushan Hanuska [Atlassian]
              dushan@atlassian.com Dushan Hanuska [Atlassian]
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2h
                  2h