events.rst 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. Events
  2. ======
  3. Datepicker triggers a number of events in certain circumstances. All events have extra data attached to the event object that is passed to any event handlers
  4. ::
  5. $('.datepicker').datepicker()
  6. .on(picker_event, function(e) {
  7. // `e` here contains the extra attributes
  8. });
  9. * ``date``: the relevant Date object, in local timezone. For a multidate picker, this will be the latest date picked.
  10. * ``dates``: an Array of Date objects, in local timezone, when using a multidate picker.
  11. * ``format([ix], [format])``: a function to make formatting ``date`` easier. ``ix`` can be the index of a Date in the ``dates`` array to format; if absent, the last date selected will be used. ``format`` can be any format string that datepicker supports; if absent, the format set on the datepicker will be used. Both arguments are optional.
  12. show
  13. ----
  14. Fired when the date picker is displayed.
  15. hide
  16. ----
  17. Fired when the date picker is hidden.
  18. clearDate
  19. ---------
  20. Fired when the date is cleared, normally when the "clear" button (enabled with the ``clearBtn`` option) is pressed.
  21. changeDate
  22. ----------
  23. Fired when the date is changed.
  24. changeMonth
  25. -----------
  26. Fired when the *view* month is changed from year view.
  27. changeYear
  28. ----------
  29. Fired when the *view* year is changed from decade view.
  30. changeDecade
  31. ------------
  32. Fired when the *view* decade is changed from century view.
  33. changeCentury
  34. -------------
  35. Fired when the *view* century is changed from millennium view.