You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Events.md 1.6 KiB

4 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. ## Events
  2. ### dp.hide
  3. Fired when the widget is hidden.
  4. Parameters:
  5. ```
  6. e = {
  7. date //the currently set date. Type: moment object (clone)
  8. }
  9. ```
  10. Emitted from:
  11. * toggle()
  12. * hide()
  13. * disable()
  14. ----------------------
  15. ### dp.show
  16. Fired when the widget is shown.
  17. Parameters:
  18. No parameters are include, listen to `dp.change` instead
  19. Emitted from:
  20. * toggle()
  21. * show()
  22. ----------------------
  23. ### dp.change
  24. Fired when the date is changed, including when changed to a non-date (e.g. When keepInvalid=true).
  25. Parameters:
  26. ```
  27. e = {
  28. date, //date the picker changed to. Type: moment object (clone)
  29. oldDate //previous date. Type: moment object (clone) or false in the event of a null
  30. }
  31. ```
  32. Emitted from:
  33. * toggle() **Note**: Only fired when using `useCurrent`
  34. * show() **Note**: Only fired when using `useCurrent` or when or the date is changed to comply with date rules (min/max etc)
  35. * date(newDate)
  36. * minDate(minDate)
  37. * maxDate(maxDate)
  38. * daysOfWeekDisabled()
  39. ----------------------
  40. ### dp.error
  41. Fired when a selected date fails to pass validation.
  42. Parameters:
  43. ```
  44. e = {
  45. date //the invalid date. Type: moment object (clone)
  46. oldDate //previous date. Type: moment object (clone) or false in the event of a null
  47. }
  48. ```
  49. Emmited from:
  50. * minDate(minDate)
  51. * maxDate(maxDate)
  52. * daysOfWeekDisabled()
  53. * setValue() *private function*
  54. ----------------------
  55. ### dp.update
  56. <small>4.14.30</small>
  57. Fired (in most cases) when the `viewDate` changes. E.g. Next and Previous buttons, selecting a year.
  58. Parameters:
  59. ```
  60. e = {
  61. change, //Change type as a momentjs format token. Type: string e.g. yyyy on year change
  62. viewDate //new viewDate. Type: moment object
  63. }
  64. ```