Dashboard sipadu mbip
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.

calendar.js 3.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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. setTimeout(function(){
  17. $('#calendar').fullCalendar({
  18. header: {
  19. left: 'prev,next today',
  20. center: 'title',
  21. right: 'month,agendaWeek,agendaDay,listMonth'
  22. },
  23. defaultDate: '2018-09-12',
  24. navLinks: true, // can click day/week names to navigate views
  25. businessHours: true, // display business hours
  26. editable: true,
  27. droppable: true, // this allows things to be dropped onto the calendar
  28. drop: function() {
  29. // is the "remove after drop" checkbox checked?
  30. if ($('#checkbox2').is(':checked')) {
  31. // if so, remove the element from the "Draggable Events" list
  32. $(this).remove();
  33. }
  34. },
  35. events: [{
  36. title: 'Business Lunch',
  37. start: '2018-09-03T13:00:00',
  38. constraint: 'businessHours',
  39. borderColor: '#FC6180',
  40. backgroundColor: '#FC6180',
  41. textColor: '#fff'
  42. }, {
  43. title: 'Meeting',
  44. start: '2018-09-13T11:00:00',
  45. constraint: 'availableForMeeting',
  46. editable: true,
  47. borderColor: '#4680ff',
  48. backgroundColor: '#4680ff',
  49. textColor: '#fff'
  50. }, {
  51. title: 'Conference',
  52. start: '2018-09-18',
  53. end: '2018-09-20',
  54. borderColor: '#93BE52',
  55. backgroundColor: '#93BE52',
  56. textColor: '#fff'
  57. }, {
  58. title: 'Party',
  59. start: '2018-09-29T20:00:00',
  60. borderColor: '#FFB64D',
  61. backgroundColor: '#FFB64D',
  62. textColor: '#fff'
  63. },
  64. // areas where "Meeting" must be dropped
  65. {
  66. id: 'availableForMeeting',
  67. start: '2018-09-11T10:00:00',
  68. end: '2018-09-11T16:00:00',
  69. rendering: 'background',
  70. borderColor: '#ab7967',
  71. backgroundColor: '#ab7967',
  72. textColor: '#fff'
  73. }, {
  74. id: 'availableForMeeting',
  75. start: '2018-09-13T10:00:00',
  76. end: '2018-09-13T16:00:00',
  77. rendering: 'background',
  78. borderColor: '#39ADB5',
  79. backgroundColor: '#39ADB5',
  80. textColor: '#fff'
  81. },
  82. // red areas where no events can be dropped
  83. {
  84. start: '2018-09-24',
  85. end: '2018-09-28',
  86. overlap: false,
  87. rendering: 'background',
  88. borderColor: '#FFB64D',
  89. backgroundColor: '#FFB64D',
  90. color: '#d8d6d6'
  91. }, {
  92. start: '2018-09-06',
  93. end: '2018-09-08',
  94. overlap: false,
  95. rendering: 'background',
  96. borderColor: '#ab7967',
  97. backgroundColor: '#ab7967',
  98. color: '#d8d6d6'
  99. }
  100. ]
  101. });
  102. },350);
  103. });