Hi there anybody use jQuery pit-scheduler in react environment.
In my public HTML I write my script tag. after link my index.js page. But this error occur.
Uncaught TypeError: $(…).pitScheduler is not a function
Uncaught SyntaxError: Unexpected token <
Can’t tell what the issue is as can’t see the code: it sounds like there is a syntax error in your HTML and/or you’re trying to run the function before the library is available.
Unfortunately I can’t seem to look at any documentation either as the plugin seems to be dead.
This file located in public/index.html
<link rel="stylesheet" type="text/css" href="./vendors/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="./vendors/css/bootstrap-datetimepicker.css">
<link rel="stylesheet" type="text/css" href="./vendors/dist/css/pitscheduler.min.css">
<link rel="stylesheet" type="text/css" href="./vendors/css/demo.css">
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.24.0/moment-with-locales.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.8.0/js/bootstrap-datepicker.js"></script>
<script src='vendors/dist/js/pitscheduler.min.js'></script>
<script>
$(document).ready(function(){
$('#pit-scheduler').pitScheduler({
locale: 'en',
defaultDisplay: 'months',
hideEmptyLines: true,
disableLabelsMovement: false,
defaultGroupName: 'Default group',
defaultDate: '2016-09-01 16:30',
disableNotifications: false,
notificationDuration: 4000,
hideSpinner: true,
onChange: '',
onTaskCreation: '',
onUserCreation: '',
onTaskRemoval: '',
onUserRemoval: '',
onUserEdition: '',
onTaskAssignation: '',
onUserTaskDeletion: '',
onTaskEdition: '',
disableUndo: false,
resizeTask: true,
tasks: [
{
id: 'djJ3d7sjk928S0',
name: 'Jacuzzi access',
description: 'Allows users to access to the jacuzzi',
color: '#fcd720',
tag: 'limited places',
tagColor: '#50d371'
},
{
id: 'fJD67Bd4jh7',
name: 'SPA access',
description: 'Allows usesr to access to the SPA',
color: '#E91E63'
},
{
id: 'dj8aA9nL0Su7',
name: 'Internet access',
description: 'Allows users to access to internet',
color: '#536DFE'
},
{
id: 'fLKd67zPkj',
name: 'VIP services',
color: '#50d371',
tag: 'Only VIPs',
tagColor: '#d200a5'
}
],
users: [
{
name: 'Ai WeiWei',
group: 'Group A',
tasks: [
{
id: 'djJ3d7sjk928S0',
start_date: '2015-09-10 00:00',
end_date: '2016-09-20 00:00'
},
{
id: 'djJ3d7sjk928S0',
start_date: '2016-09-28 6:00',
end_date: '2017-09-28 18:30'
},
{
id: 'fJD67Bd4jh7',
start_date: '2016-09-08 10:40',
end_date: '2016-09-21 16:00'
},
{
id: 'fJD67Bd4jh7',
start_date: '2016-09-23 10:10',
end_date: '2016-09-29 16:50'
},
{
id: 'fLKd67zPkj',
start_date: '2016-09-10 08:00',
end_date: '2016-09-12 20:00'
}
]
},
{
name: 'Michel Petrucciani',
group: 'Group A',
tasks: [
{
id: 'djJ3d7sjk928S0',
start_date: '2016-09-01 06:00',
end_date: '2016-09-04 00:00'
},
{
id: 'djJ3d7sjk928S0',
start_date: '2016-09-04 11:00',
end_date: '2016-09-08 18:00'
},
{
id: 'fLKd67zPkj',
start_date: '2016-09-07 17:00',
end_date: '2016-09-11 20:00'
}
]
},
{
name: 'Jimi Hendrix',
group: 'Group B',
tasks: [
{
id: 'djJ3d7sjk928S0',
start_date: '2016-09-01 02:30',
end_date: '2016-09-03 09:00'
},
{
id: 'djJ3d7sjk928S0',
start_date: '2016-09-04 17:30',
end_date: '2016-09-24 07:42'
},
{
id: 'dj8aA9nL0Su7',
start_date: '2016-09-02 17:30',
end_date: '2016-09-11 07:42'
},
{
id: 'fJD67Bd4jh7',
start_date: '2016-09-13 10:00',
end_date: '2016-09-26 16:00'
},
{
id: 'fJD67Bd4jh7',
start_date: '2016-09-30 10:00',
end_date: '2016-10-05 16:00'
},
{
id: 'fJD67Bd4jh7',
start_date: '2016-10-23 10:00',
end_date: '2016-11-04 16:00'
},
{
id: 'fJD67Bd4jh7',
start_date: '2016-11-06 10:00',
end_date: '2016-11-09 16:00'
},
{
id: 'fJD67Bd4jh7',
start_date: '2016-11-10 10:00',
end_date: '2016-11-21 16:00'
},
{
id: 'fLKd67zPkj',
start_date: '2016-09-01 08:00',
end_date: '2016-09-10 18:00'
},
{
id: 'fLKd67zPkj',
start_date: '2016-09-12 08:00',
end_date: '2016-09-21 18:00'
}
]
}
]
});
});
</script>
After this file linked to src/form/schedule/index.js
<div id="pit-scheduler"></div>
This file there are no one import any special libraries like jQuery, bootstrap, bootstrap-datetimepicker
Is this path correct, and is this loading:
<script src='vendors/dist/js/pitscheduler.min.js'></script>
Because the error indicates that that it either isn’t being picked up (pitScheduler is not a function
) or it’s called something different
This path is loading. I get this code from
https://github.com/chuck-durst/pit-scheduler-DEPRECATED-