Guest User

Untitled

a guest
Jul 17th, 2017
302
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.25 KB | None | 0 0
  1. $('#calendar').fullCalendar({
  2. header: {
  3. left: 'prev,next today',
  4. center: 'title',
  5. right: 'month,agendaWeek,agendaDay'
  6. },
  7.  
  8. events: _this.state.events,
  9. defaultView:'month',
  10. displayEventTime: false,
  11. editable: false,
  12. droppable: false,
  13. durationEditable: false
  14. });
  15.  
  16. viewRender: function(view, element) {
  17. //note: this is a hack, i don't know why the view title keep showing "undefined" text in it.
  18. //probably bugs in jquery fullcalendar
  19. $('.fc-center')[0].children[0].innerText = view.title.replace(new RegExp("undefined", 'g'), ""); ;
  20.  
  21. },
  22.  
  23. [{"start":"2017-03-24T00:00:00.000Z","end":"2017-03-26T00:00:00.000Z","title":"Open house","description":"Bali 1 open house"}]
  24.  
  25. @Scripts.Render("~/bundles/dates")
  26.  
  27. <script src='//cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.min.js'></script>
  28.  
  29. <link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" rel="stylesheet" />
  30. <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" />
  31. <link href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.css" rel="stylesheet" />
  32. <link href="http://cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.4.0/fullcalendar.css" rel="stylesheet" />
  33.  
  34.  
  35. <script src="http://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.min.js"></script>
  36. <script src="https://code.jquery.com/jquery-3.2.1.js"
  37. integrity="sha256-DZAnKJ/6XZ9si04Hgrsxu/8s717jcIzLy3oi35EouyE="
  38. crossorigin="anonymous"></script>
  39. <script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.js"></script>
  40. <script src="http://npmcdn.com/[email protected]/dist/js/tether.min.js"></script>
  41. <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js"></script>
  42. <script src="http://cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.4.0/fullcalendar.js"></script>
  43. <script src="http://cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.4.0/locale/fr.js"></script>
  44.  
  45. <script src="~/Scripts/VisiteCalendar.js"></script>
  46.  
  47. $(document).ready(function () {
  48.  
  49.  
  50. var sourceFullView = { url: '/Vue_visite/GetEvents/' };
  51. //var sourceSummaryView = { url: '/Home/GetDiarySummary/' };
  52. var CalLoading = true;
  53. $('#calendar').fullCalendar({
  54.  
  55.  
  56. customButtons: {
  57. AgendaWeek: {
  58. text: 'Semaine',
  59. click: function () {
  60. $('#calendar').fullCalendar('changeView', 'agendaWeek');
  61. }
  62. },
  63. AgendaDay: {
  64. text: 'Jour',
  65. click: function () {
  66. $('#calendar').fullCalendar('changeView', 'agendaDay');
  67. }
  68. }
  69. },
  70. header: {
  71. left: 'prev,next, today',
  72. center: 'title',
  73. right: 'month,AgendaWeek,AgendaDay'
  74. },
  75.  
  76. // //editing
  77. editable: true,
  78. disableDragging: true,
  79. disableResizing: true,
  80. slotLabelFormat: "HH:mm",
  81. defaultDate: moment(),
  82. navLinks: true, // can click day/week names to navigate views
  83. defaultView: 'agendaWeek',
  84. nowIndicator: true,
  85.  
  86. weekends: true,
  87. weekNumbers: true,
  88. weekNumbersWithinDays: true,
  89.  
  90. showNonCurrentDates: true,
  91.  
  92. locale: 'fr',
  93. lang: 'fr',
  94. timezone: 'Europe/Paris',
  95. allDaySlot: false,
  96. allDayDefault: true,
  97. eventLimit: true,
  98.  
  99.  
  100. // jquery-ui theming
  101. theme: false,
  102. height: 515,
  103. aspectRatio: 2,
  104.  
  105. forceEventDuration: true,
  106.  
  107. businessHours: {
  108. // days of week. an array of zero-based day of week integers (0=Sunday)
  109. dow: [1, 2, 3, 4, 5], // Monday - Thursday
  110.  
  111. start: '8:00', // a start time (10am in this example)
  112. end: '18:00', // an end time (6pm in this example)
  113. },
  114. minTime: "08:00:00",
  115. maxTime: "18:00:00",
  116.  
  117.  
  118. //selectable: false,
  119. unselectAuto: true,
  120.  
  121. dropAccept: '*',
  122.  
  123. handleWindowResize: true,
  124. events: '/Vue_visite/GetEvents/',
  125.  
  126. eventClick: function (event, jsEvent, view) {
  127. $('#modalTitle').html(event.url);
  128. $('#modalBody').html(event.descriptionComplete);
  129. $('#eventUrl').attr('href', event.url);
  130. $('#fullCalModal').modal();
  131. },
  132.  
  133. dayClick: function (date, allDay, jsEvent, view) {
  134. $('#eventTitle').val("");
  135. $('#eventDate').val($.fullCalendar.formatDate(date, 'dd/MM/yyyy'));
  136. $('#eventTime').val($.fullCalendar.formatDate(date, 'HH:mm'));
  137. ShowEventPopup(date);
  138. }
  139.  
  140. });});
Advertisement
Add Comment
Please, Sign In to add comment