Permalink
Browse files

fixing events on dateinput

added beforeChange event and now trigger change event after value has been set
  • Loading branch information...
1 parent 29a0e14 commit 9cb13eb15d098a8e7831424d8a8f216cfee3f5f3 @bradrobertson bradrobertson committed Sep 10, 2011
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/dateinput/dateinput.js
View
8 src/dateinput/dateinput.js
@@ -283,16 +283,20 @@
currDay = date.getDate();
- // change
+ // beforChange
e = e || $.Event("api");
- e.type = "change";
+ e.type = "beforeChange";
fire.trigger(e, [date]);
if (e.isDefaultPrevented()) { return; }
// formatting
input.val(format(date, conf.format, conf.lang));
+ // change
+ e.type = "change";
+ fire.trigger(e);
+
// store value into input
input.data("date", date);

0 comments on commit 9cb13eb

Please sign in to comment.