day_render.html 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <link href='../dist/fullcalendar.css' rel='stylesheet' />
  5. <link href='../dist/fullcalendar.print.css' rel='stylesheet' media='print' />
  6. <script src='../lib/jquery/jquery.js'></script>
  7. <script src='../lib/jquery-ui/ui/jquery-ui.js'></script>
  8. <script src='../lib/moment/moment.js'></script>
  9. <script src='../dist/fullcalendar.js'></script>
  10. <script>
  11. $(document).ready(function() {
  12. var date = new Date();
  13. var d = date.getDate();
  14. var m = date.getMonth();
  15. var y = date.getFullYear();
  16. $('#calendar').fullCalendar({
  17. dayRender: function(date, td) {
  18. //console.log(date, td);
  19. td.find('.fc-day-content').prepend('this is the ' + date.getDate());
  20. },
  21. dayClick: function(date, allDay) {
  22. console.log(date, allDay);
  23. },
  24. weekNumbers: true,
  25. //selectable: true,
  26. //isRTL: true,
  27. header: {
  28. left: 'prev,next today',
  29. center: 'title',
  30. right: 'month,agendaWeek,basicWeek,agendaDay,basicDay'
  31. },
  32. editable: true,
  33. events: [
  34. {
  35. title: 'All Day Event',
  36. start: new Date(y, m, 1)
  37. },
  38. {
  39. title: 'Long Event',
  40. start: new Date(y, m, d-5),
  41. end: new Date(y, m, d-2)
  42. },
  43. {
  44. id: 999,
  45. title: 'Repeating Event',
  46. start: new Date(y, m, d-3, 16, 0),
  47. allDay: false
  48. },
  49. {
  50. id: 999,
  51. title: 'Repeating Event',
  52. start: new Date(y, m, d+4, 16, 0),
  53. allDay: false
  54. },
  55. {
  56. title: 'Meeting',
  57. start: new Date(y, m, d, 10, 30),
  58. allDay: false
  59. },
  60. {
  61. title: 'Lunch',
  62. start: new Date(y, m, d, 12, 5),
  63. end: new Date(y, m, d, 14, 43),
  64. allDay: false
  65. },
  66. {
  67. title: 'Birthday Party',
  68. start: new Date(y, m, d+1, 19, 0),
  69. end: new Date(y, m, d+1, 22, 30),
  70. allDay: false
  71. },
  72. {
  73. title: 'Click for Google',
  74. start: new Date(y, m, 28),
  75. end: new Date(y, m, 29),
  76. url: 'http://google.com/'
  77. }
  78. ]
  79. });
  80. });
  81. </script>
  82. <style>
  83. body {
  84. margin-top: 40px;
  85. text-align: center;
  86. font-size: 13px;
  87. font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif;
  88. }
  89. #calendar {
  90. width: 900px;
  91. margin: 0 auto;
  92. }
  93. </style>
  94. </head>
  95. <body>
  96. <div id='calendar'></div>
  97. </body>
  98. </html>