Installing
Minimal Requirements
- jQuery
- Moment.js
- Bootstrap.js
- Bootstrap Datetimepicker
- Bootstrap DatetimePicker CSS
- Bootstrap CSS
Installation Guide
NPM
Run the following command:npm i pit-scheduler --save
Include the necessary scripts and styles:
<head>
<!-- ... -->
<link rel="stylesheet" type="text/css" href="/node_modules/bootstrap/dist/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="/node_modules/bootstrap-datetimepicker/src/less/bootstrap-datetimepicker.less">
<link rel="stylesheet" type="text/css" href="/node_modules/pit-scheduler/src/css/pitscheduler.min.css">
<script src="/node_modules/jquery/dist/jquery.min.js"></script>
<script src="/node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="/node_modules/momentjs/build/moment.min.js"></script>
<script src="/node_modules/bootstrap-datetimepicker/src/js/bootstrap-datetimepicker.js"></script>
<script src="/node_modules/pit-scheduler/dist/js/pitscheduler.min.css"></script>
<!-- ... -->
</head>
Manual installation
Run the following command to clone the repository:git clone https://github.com/chuck-durst/pit-scheduler
You can also download the .zip file Here
Include the necessary scripts and styles:
<head>
<!-- ... -->
<link rel="stylesheet" type="text/css" href="/path/to/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="/path/to/bootstrap-datetimepicker.less">
<link rel="stylesheet" type="text/css" href="/path/to/pitscheduler.min.css">
<script src="/path/to/jquery.min.js"></script>
<script src="/path/to/bootstrap.min.js"></script>
<script src="/path/to/moment.min.js"></script>
<script src="/path/to/bootstrap-datetimepicker.js"></script>
<script src="/path/to/pitscheduler.min.css"></script>
<!-- ... -->
</head>
Usage
Now you are ready to go! To display the scheduler, simply use Javascript to create a new instance of the module:
$(document).ready(function () {
$("#pit-scheduler").pitScheduler(/* options */);
});
and then put the element wherever you want in the page:
<div id="pit-scheduler"></div>
Note: You can only use one instance of the scheduler per page!
Locales
By default, all the scheduler files work with the english language.If you want to use the scheduler with an other language, it's quite simple. In fact, there is two ways:
- Add the
pitscheduler-with-locales.min.jsfile, which will load all the locales - Use the default scheduler Js file and add the needed locale file separately from dist/js/locales/
Note: If your language is not available, you can easily create your own locale file. Just follow the existing pattern! In this case, do not forget to share your translation with use!