week_numbers.html 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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. weekNumbers: true,
  17. weekText: 'Wk',
  18. //weekNumberCalculation: function(date) {
  19. // return date.getMonth(); // inappropriate. but just for testing
  20. //},
  21. firstDay: 1,
  22. selectable: true,
  23. //direction: 'rtl',
  24. editable: true,
  25. headerToolbar: {
  26. left: 'prev,next today',
  27. center: 'title',
  28. right: 'month,week,dayGridWeek,day,dayGridDay'
  29. },
  30. events: [
  31. {
  32. title: 'All Day Event',
  33. start: new Date(y, m, 1)
  34. },
  35. {
  36. title: 'Long Event',
  37. start: new Date(y, m, d-5),
  38. end: new Date(y, m, d-2)
  39. },
  40. {
  41. groupId: 999,
  42. title: 'Repeating Event',
  43. start: new Date(y, m, d-3, 16, 0),
  44. allDay: false
  45. },
  46. {
  47. groupId: 999,
  48. title: 'Repeating Event',
  49. start: new Date(y, m, d+4, 16, 0),
  50. allDay: false
  51. },
  52. {
  53. title: 'Meeting',
  54. start: new Date(y, m, d, 10, 30),
  55. allDay: false
  56. },
  57. {
  58. title: 'Lunch',
  59. start: new Date(y, m, d, 12, 5),
  60. end: new Date(y, m, d, 14, 43),
  61. allDay: false
  62. },
  63. {
  64. title: 'Birthday Party',
  65. start: new Date(y, m, d+1, 19, 0),
  66. end: new Date(y, m, d+1, 22, 30),
  67. allDay: false
  68. },
  69. {
  70. title: 'Click for Google',
  71. start: new Date(y, m, 28),
  72. end: new Date(y, m, 29),
  73. url: 'http://google.com/'
  74. }
  75. ]
  76. });
  77. });
  78. </script>
  79. <style>
  80. body {
  81. margin-top: 40px;
  82. text-align: center;
  83. font-size: 13px;
  84. font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif;
  85. }
  86. #calendar {
  87. width: 900px;
  88. margin: 0 auto;
  89. }
  90. </style>
  91. </head>
  92. <body>
  93. <div id='calendar'></div>
  94. </body>
  95. </html>