languages.html 2.6 KB

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