languages.html 2.9 KB

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