methods.txt 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. Methods
  2. =======
  3. The following are methods that can be called on a FullCalendar-initialized
  4. jQuery object:
  5. **prev** - .fullCalendar('prev')
  6. Moves the calendar one step back (either by a month, week, or day).
  7. **next** - .fullCalendar('next')
  8. Moves the calendar one step forward (either by a month, week, or day).
  9. **today** - .fullCalendar('today')
  10. Moves the calendar to the current date.
  11. **gotoDate** - .fullCalendar('gotoDate', *year, [month, [date]]*)
  12. Moves the calendar to an arbitrary year/month/date.
  13. ``month`` is 0-based, meaning January=0, February=1, etc.
  14. **incrementDate** - .fullCalendar('incrementDate', *years, [months, [days]]*)
  15. Moves the calendar forward/backward an arbitrary amount of time.
  16. **updateEvent** - .fullCalendar('updateEvent', *calEvent*)
  17. Reports changes to a :ref:`CalEvent's <CalEvent>` standard properties.
  18. This will cause the event to be rerendered on the calendar.
  19. If there are repeating events on the calendar with the
  20. same ID, these events will be changed as well.
  21. ``calEvent`` must be a :ref:`CalEvent <CalEvent>` retrieved from a
  22. :ref:`Triggered Action<triggered-actions>` or from the ``clientEvents`` method.
  23. **renderEvent** - .fullCalendar('renderEvent', *calEvent, [stick]*)
  24. Renders a new event on the calendar. ``calEvent`` must have
  25. at least a ``title`` and a ``start``.
  26. By default, the event will disappear once the calendar refetches its event
  27. sources (example: when prev/next is clicked). However, specifying ``stick`` as ``true``
  28. will cause the event to be permanently fixed to the calendar.
  29. **removeEvents** - .fullCalendar('removeEvents', *[idOrFilter]*)
  30. If the second argument is omitted, all events are removed.
  31. If the second argument is an ID, all events with
  32. the same ID will be removed.
  33. The second argument may also be a filter function that accepts
  34. one :ref:`CalEvent <CalEvent>` argument and returns ``true`` if it
  35. should be removed.
  36. **clientEvents** - .fullCalendar('clientEvents', *[idOrFilter]*)
  37. This method will return an array of :ref:`CalEvents <CalEvent>` that
  38. FullCalendar has stored on the client-side (browser).
  39. If the second argument is omitted, all events will be returned.
  40. If the second argument is an ID, all events with the
  41. same ID will be returned.
  42. The second argument may also be a filter function that accepts
  43. one :ref:`CalEvent <CalEvent>` argument and returns ``true`` if it should
  44. be included in the result set.
  45. **addEventSource** - .fullCalendar('addEventSource', *source*)
  46. Adds an :ref:`Event Source <event-sources>`. ``source`` may be an array/string/function just as in
  47. the ``events`` option. Events will be immediately fetched from this source
  48. and placed on the calendar.
  49. **removeEventSource** - .fullCalendar('removeEventSource', *source*)
  50. Removes an :ref:`Event Source <event-sources>`. ``source`` must be a reference to the
  51. original array/string/function. Events from the source will immediately be
  52. removed from the calendar.
  53. **rerenderEvents** - .fullCalendar(``'rerenderEvents'``)
  54. Rerenders all events on the screen.
  55. **refetchEvents** - .fullCalendar(``'refetchEvents'``)
  56. Refetches events from all sources and rerenders them on the screen.