day_render.html 2.4 KB

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