You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

110 lines
3.5 KiB

1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. "use strict";
  2. $(document).ready(function() {
  3. $('#external-events .fc-event').each(function() {
  4. // store data so the calendar knows to render an event upon drop
  5. $(this).data('event', {
  6. title: $.trim($(this).text()), // use the element's text as the event title
  7. stick: true // maintain when user navigates (see docs on the renderEvent method)
  8. });
  9. // make the event draggable using jQuery UI
  10. $(this).draggable({
  11. zIndex: 999,
  12. revert: true, // will cause the event to go back to its
  13. revertDuration: 0 // original position after the drag
  14. });
  15. });
  16. $('#calendar').fullCalendar({
  17. header: {
  18. left: 'prev,next today',
  19. center: 'title',
  20. right: 'month,agendaWeek,agendaDay,listMonth'
  21. },
  22. defaultDate: '2016-09-12',
  23. navLinks: true, // can click day/week names to navigate views
  24. businessHours: true, // display business hours
  25. editable: true,
  26. droppable: true, // this allows things to be dropped onto the calendar
  27. drop: function() {
  28. // is the "remove after drop" checkbox checked?
  29. if ($('#checkbox2').is(':checked')) {
  30. // if so, remove the element from the "Draggable Events" list
  31. $(this).remove();
  32. }
  33. },
  34. events: [{
  35. title: 'Business Lunch',
  36. start: '2016-09-03T13:00:00',
  37. constraint: 'businessHours',
  38. borderColor: '#FC6180',
  39. backgroundColor: '#FC6180',
  40. textColor: '#fff'
  41. }, {
  42. title: 'Meeting',
  43. start: '2016-09-13T11:00:00',
  44. constraint: 'availableForMeeting',
  45. editable: true,
  46. borderColor: '#4680ff',
  47. backgroundColor: '#4680ff',
  48. textColor: '#fff'
  49. }, {
  50. title: 'Conference',
  51. start: '2016-09-18',
  52. end: '2016-09-20',
  53. borderColor: '#93BE52',
  54. backgroundColor: '#93BE52',
  55. textColor: '#fff'
  56. }, {
  57. title: 'Party',
  58. start: '2016-09-29T20:00:00',
  59. borderColor: '#FFB64D',
  60. backgroundColor: '#FFB64D',
  61. textColor: '#fff'
  62. },
  63. // areas where "Meeting" must be dropped
  64. {
  65. id: 'availableForMeeting',
  66. start: '2016-09-11T10:00:00',
  67. end: '2016-09-11T16:00:00',
  68. rendering: 'background',
  69. borderColor: '#ab7967',
  70. backgroundColor: '#ab7967',
  71. textColor: '#fff'
  72. }, {
  73. id: 'availableForMeeting',
  74. start: '2016-09-13T10:00:00',
  75. end: '2016-09-13T16:00:00',
  76. rendering: 'background',
  77. borderColor: '#39ADB5',
  78. backgroundColor: '#39ADB5',
  79. textColor: '#fff'
  80. },
  81. // red areas where no events can be dropped
  82. {
  83. start: '2016-09-24',
  84. end: '2016-09-28',
  85. overlap: false,
  86. rendering: 'background',
  87. borderColor: '#FFB64D',
  88. backgroundColor: '#FFB64D',
  89. color: '#d8d6d6'
  90. }, {
  91. start: '2016-09-06',
  92. end: '2016-09-08',
  93. overlap: false,
  94. rendering: 'background',
  95. borderColor: '#ab7967',
  96. backgroundColor: '#ab7967',
  97. color: '#d8d6d6'
  98. }
  99. ]
  100. });
  101. });