Opened 8 years ago

Closed 8 years ago

#15186 closed defect (fixed)

Bug on trunk: dojo/date/locale.js incorrectly uses boolean operator for case 'c'

Reported by: Nick Fenwick Owned by: Adam Peller
Priority: high Milestone: 1.8
Component: Date Version: 1.7.2
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by Adam Peller)

dojo/date/locale.js on trunk r28349:

    var days = bundle['days-' +
      c == 'c' ? 'standAlone' : 'format' +
      '-' + widthList[l-3]].concat();

This drops the 'days-' prefix due to poorly scoped ? operator usage.

Fix:

    var days = bundle['days-' +
      (c == 'c' ? 'standAlone' : 'format' +
      '-' + widthList[l-3])].concat();

Probably worth hunting other changes made in the changeset that introduced this bug to see what other problems are lurking. I haven't tested any other execution paths.

Attachments (2)

test.html (694 bytes) - added by Nick Fenwick 8 years ago.
Test file using a local copy of trunk, fails in parse call.
patch.diff (508 bytes) - added by Nick Fenwick 8 years ago.
Unified diff patch for dojo/date/locale.js

Download all attachments as: .zip

Change History (8)

Changed 8 years ago by Nick Fenwick

Attachment: test.html added

Test file using a local copy of trunk, fails in parse call.

comment:1 Changed 8 years ago by bill

Component: GeneralDate
Owner: set to Adam Peller

comment:2 Changed 8 years ago by Adam Peller

Milestone: tbd1.8
Priority: undecidedhigh
Status: newassigned

Changed 8 years ago by Nick Fenwick

Attachment: patch.diff added

Unified diff patch for dojo/date/locale.js

comment:3 Changed 8 years ago by Nick Fenwick

Attached a patch file to make the fix bleedingly obvious. Shouldn't this be milestone 1.7.3?

The nightly tests for DateTextBox? works fine, at http://archive.dojotoolkit.org/nightly/dojotoolkit/dijit/tests/form/test_DateTextBox.html, but from the look of the code they're using 1.8.0 dev and haven't yet had this buggy code included in them.

comment:4 Changed 8 years ago by Adam Peller

Description: modified (diff)

comment:5 Changed 8 years ago by Adam Peller

neek, thank you, I missed that one. there was a similar fix in r28119. None of this should have been in the 1.7 release, however.

comment:6 Changed 8 years ago by Adam Peller

Resolution: fixed
Status: assignedclosed

In [28380]:

Fixes #15186 one more order of ops correction. thanks, neek

Note: See TracTickets for help on using tickets.