Skip to content

Commit 6df3ddc

Browse files
committed
fetch e before using it
1 parent 8579f2f commit 6df3ddc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/dateinput/dateinput.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,13 +282,14 @@
282282
currMonth = date.getMonth();
283283
currDay = date.getDate();
284284

285+
e || (e = $.Event("api"));
286+
285287
// focus the input after selection (doesn't work in IE)
286288
if (e.type == "click" && !$.browser.msie) {
287289
input.focus();
288290
}
289291

290292
// beforeChange
291-
e = e || $.Event("api");
292293
e.type = "beforeChange";
293294

294295
fire.trigger(e, [date]);
@@ -420,7 +421,7 @@
420421

421422
// month selector
422423
monthSelector.unbind("change").change(function() {
423-
self.setValue(yearSelector.val(), $(this).val());
424+
self.setValue(yearSelector.val(), $(this).val());
424425
});
425426

426427
// year selector

0 commit comments

Comments
 (0)