Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#10864 closed defect (fixed)

dijit.Calendar.goToToday does not work

Reported by: navtej Owned by: Adam Peller
Priority: high Milestone: 1.4.3
Component: Dijit Version: 1.4.0
Keywords: Cc:
Blocked By: Blocking:

Description

create a new dijit.Calendar and call goToToday() on it. Nothing will happen.

This is because goToToday invokes "this.dateClassObj()" and not "new this.dateClassObj()". The former returns a string and the latter returns a Date object. The string would be fine, but _setValueAttr calls compare which uses the unary + operator to turn the value into a number (presumably in an attempt to copy the date). This would work fine with a Date object but not with a string.

I believe the correct thing to do here is change goToToday() to use the 'new' operator. It looks like when this function was first introduced (r11785), it did use the 'new' operator. When _Calendar was converted to use dateClassObj instead of just date, the 'new' operator was left out (r17172)

Change History (4)

comment:1 Changed 9 years ago by Adam Peller

Milestone: tbd1.5
Owner: set to Adam Peller
Status: newassigned

comment:2 Changed 9 years ago by Adam Peller

Resolution: fixed
Status: assignedclosed

(In [21602]) Fixes regression in goToToday() from r17172. Fixes #10864, refs #5074 !strict

comment:3 Changed 9 years ago by Adam Peller

(In [21605]) Fix goToToday regression, Fixes #10864 !strict

comment:4 Changed 9 years ago by Adam Peller

Milestone: 1.51.4.3
Note: See TracTickets for help on using tickets.