Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 
 
 

140 rader
5.0 KiB

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset='utf-8' />
  5. <link rel='stylesheet' href='../lib/cupertino/jquery-ui.min.css' />
  6. <link href='../fullcalendar.css' rel='stylesheet' />
  7. <link href='../fullcalendar.print.css' rel='stylesheet' media='print' />
  8. <script src='../lib/moment.min.js'></script>
  9. <script src='../lib/jquery.min.js'></script>
  10. <script src='../fullcalendar.min.js'></script>
  11. <script src='../lang-all.js'></script>
  12. <script>
  13. $(document).ready(function()
  14. {
  15. var currentLangCode = 'en';
  16. // build the language selector's options
  17. $.each($.fullCalendar.langs, function(langCode)
  18. {
  19. $('#lang-selector').append($('<option/>').attr('value', langCode).prop('selected', langCode == currentLangCode).text(langCode));
  20. });
  21. // rerender the calendar when the selected option changes
  22. $('#lang-selector').on('change', function()
  23. {
  24. if (this.value)
  25. {
  26. currentLangCode = this.value;
  27. $('#calendar').fullCalendar('destroy');
  28. renderCalendar();
  29. }
  30. });
  31. function renderCalendar()
  32. {
  33. $('#calendar').fullCalendar(
  34. {
  35. header:
  36. {
  37. left: 'prev,next today',
  38. center: 'title',
  39. right: 'month,agendaWeek,agendaDay'
  40. },
  41. defaultDate: '2015-02-12',
  42. lang: currentLangCode,
  43. buttonIcons: false, // show the prev/next text
  44. weekNumbers: true,
  45. editable: true,
  46. eventLimit: true, // allow "more" link when too many events
  47. events: [
  48. {
  49. title: 'All Day Event',
  50. start: '2015-02-01'
  51. },
  52. {
  53. title: 'Long Event',
  54. start: '2015-02-07',
  55. end: '2015-02-10'
  56. },
  57. {
  58. id: 999,
  59. title: 'Repeating Event',
  60. start: '2015-02-09T16:00:00'
  61. },
  62. {
  63. id: 999,
  64. title: 'Repeating Event',
  65. start: '2015-02-16T16:00:00'
  66. },
  67. {
  68. title: 'Conference',
  69. start: '2015-02-11',
  70. end: '2015-02-13'
  71. },
  72. {
  73. title: 'Meeting',
  74. start: '2015-02-12T10:30:00',
  75. end: '2015-02-12T12:30:00'
  76. },
  77. {
  78. title: 'Lunch',
  79. start: '2015-02-12T12:00:00'
  80. },
  81. {
  82. title: 'Meeting',
  83. start: '2015-02-12T14:30:00'
  84. },
  85. {
  86. title: 'Happy Hour',
  87. start: '2015-02-12T17:30:00'
  88. },
  89. {
  90. title: 'Dinner',
  91. start: '2015-02-12T20:00:00'
  92. },
  93. {
  94. title: 'Birthday Party',
  95. start: '2015-02-13T07:00:00'
  96. },
  97. {
  98. title: 'Click for Google',
  99. url: 'http://google.com/',
  100. start: '2015-02-28'
  101. }]
  102. });
  103. }
  104. renderCalendar();
  105. });
  106. </script>
  107. <style>
  108. body {
  109. margin: 0;
  110. padding: 0;
  111. font-family: "Lucida Grande", Helvetica, Arial, Verdana, sans-serif;
  112. font-size: 14px;
  113. }
  114. #top {
  115. background: #eee;
  116. border-bottom: 1px solid #ddd;
  117. padding: 0 10px;
  118. line-height: 40px;
  119. font-size: 12px;
  120. }
  121. #calendar {
  122. max-width: 900px;
  123. margin: 40px auto;
  124. padding: 0 10px;
  125. }
  126. </style>
  127. </head>
  128. <body>
  129. <div id='top'> Language:
  130. <select id='lang-selector'></select>
  131. </div>
  132. <div id='calendar'></div>
  133. </body>
  134. </html>