full calendar calculate worktime per day
hallo master, I use fullcalendar. and I want to quantify or calculate "worktime" per day.Please help!!
- <script>
- $(document).ready(function() {
- $('#calendar').fullCalendar({
- dayClick: function(date, allDay, jsEvent, view) {
- if(!allDay) {
- // strip time information
- date = new Date(date.getFullYear(), date.getMonth(), date.getDay());
- }
- $('#calendar').fullCalendar('clientEvents', function(event) {
- if(event.start <= date && event.end >= date) {
-
- var a = event.worktime[0]+event.worktime[1];
- $('#id').val(a);
-
-
- }
- return false;
- });
-
- },
- header: {
- left: 'prev,next today',
- center: 'title',
- right: 'month'
- },
- defaultDate: '2016-09-12',
- //navLinks: true, // can click day/week names to navigate views
- businessHours: true, // display business hours
- editable: true,
- events: [
- {
- id:1,
- title: '10',
- start: '2016-09-03',
- end: '2016-09-05',
- worktime:'10'
- },
- {
- id:2,
- title: '15',
- start: '2016-09-03',
- end: '2016-09-05',
- worktime:'15'
- },
- {
- id:3,
- title: '5',
- start: '2016-09-06',
- end: '2016-09-10',
- worktime:'5'
- },
- ]
- });
- });
- </script>