full calendar calculate worktime per day

full calendar calculate worktime per day

hallo master, I use fullcalendar. and I want to quantify or calculate "worktime" per day.Please help!!

  1. <script>

  2. $(document).ready(function() {



  3. $('#calendar').fullCalendar({  

  4.  dayClick: function(date, allDay, jsEvent, view) {
  5.             if(!allDay) {
  6.                 // strip time information
  7.                 date = new Date(date.getFullYear(), date.getMonth(), date.getDay());
  8.             }
  9.             $('#calendar').fullCalendar('clientEvents', function(event) {

  10.                 if(event.start <= date && event.end >= date) {
  11.                
  12.                 var a = event.worktime[0]+event.worktime[1];

  13.                         $('#id').val(a);
  14.                     
  15.                                  
  16.                     }
  17.                 return false;

  18.             });
  19.              
  20.     },
  21. header: {
  22. left: 'prev,next today',
  23. center: 'title',
  24. right: 'month'
  25. },

  26. defaultDate: '2016-09-12',
  27. //navLinks: true, // can click day/week names to navigate views
  28. businessHours: true, // display business hours
  29. editable: true,
  30. events: [
  31. {
  32. id:1,
  33. title: '10',
  34. start: '2016-09-03',
  35. end: '2016-09-05',
  36. worktime:'10'

  37. },
  38. {
  39. id:2,
  40. title: '15',
  41. start: '2016-09-03',
  42. end: '2016-09-05',
  43. worktime:'15'

  44. },
  45. {
  46. id:3,
  47. title: '5',
  48. start: '2016-09-06',
  49. end: '2016-09-10',
  50. worktime:'5'

  51. },



  52. ]
  53. });

  54. });


  55. </script>