Ticket #3165 (closed bug: fixed)

Opened 6 years ago

Last modified 6 years ago

Invaild Comparsion in _changeDatePicker

Reported by: scottsloan@… Owned by: grabanski
Priority: minor Milestone:
Component: ui.datepicker Version: 1.5.2
Keywords: Cc:
Blocking: Blocked by:

Description

You are doing an assignment operation within an if statement, which will always be true

if (inst = $.data(target, PROP_NAME)) {...}

I think you wanted the comparison operator.

Should be: if (inst == $.data(target, PROP_NAME)) {...} or

if (inst === $.data(target, PROP_NAME)) {...}

Change History

comment:1 Changed 6 years ago by kbwood

  • Status changed from new to closed
  • Resolution set to fixed

The code was correct - it assigned the data values to inst and them confirmed that it was not null. However, it was unnecessarily confusing and inconsistent with the remainder of the code. Changed to conform and clarify the intent.

Note: See TracTickets for help on using tickets.