date-utils.txt 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. Date Utilities
  2. ==============
  3. **formatDate** - $.fullCalendar.formatDate(*date, formatString, [options]*)
  4. Format a date into a string value with a specified format.
  5. The format can be combinations of the following:
  6. * **s** - seconds
  7. * **ss** - seconds, 2 digits
  8. * **m** - minutes
  9. * **mm** - minutes, 2 digits
  10. * **h** - hours
  11. * **hh** - hours, 2 digits
  12. * **H** - hours, military time
  13. * **HH** - hours, milirary time, 2 digits
  14. * **d** - date number
  15. * **dd** - date number, 2 digits
  16. * **ddd** - date name, short
  17. * **dddd** - date name, full
  18. * **M** - month number
  19. * **MM** - month number, 2 digits
  20. * **MMM** - month name, short
  21. * **MMMM** - month name, full
  22. * **yy** - year, 2 digits
  23. * **yyyy** - year, 4 digits
  24. * **t** - 'a' or 'p'
  25. * **tt** - 'am' or 'pm'
  26. * **T** - 'A' or 'P'
  27. * **TT** - 'AM' or 'PM'
  28. * **u** - ISO8601 format
  29. * **S** - 'st', 'nd', 'rd', 'th' for the date
  30. Special Characters:
  31. ``'...'``
  32. literal text
  33. ``''``
  34. single quote
  35. ``(...)``
  36. only displays format if one of the enclosed variables is non-zero
  37. *options* can override any of the :ref:`Locale Options<locale>`
  38. .. _formatDates:
  39. **formatDates** - $.fullCalendar.formatDates(*date1, date2, formatString, [options]*)
  40. Similar to ``formatDate``, but accepts *two* dates, leveraging the following
  41. special characters in *formatString*:
  42. ``{...}``
  43. switches to formatting the 2nd date
  44. ``[...]``
  45. only displays the enclosed format if the current date is different from the
  46. alternate date in the same regards
  47. **parseDate** - $.fullCalendar.parseDate(*string*)
  48. Parses a string and returns a javascript Date object.
  49. The string may be in ISO8601 format, IETF format, or a UNIX timestamp.
  50. **parseISO8601** - $.fullCalendar.parseISO8601(*string, [ignoreTimezone]*)
  51. Parses an ISO8601 string into a javascript Date object.