PHP code example of components / bootstrap-datetimepicker

1. Go to this page and download the library: Download components/bootstrap-datetimepicker library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

components / bootstrap-datetimepicker example snippets

javascript
$('#date')
    .datetimepicker({
        onRenderYear: function(date) {
            //Disable picking dates from any year apart from 2015/2016
            if (date.getFullYear() < 2015 || date.getFullYear() > 2016)
                return ['disabled']
        }
    });
javascript
$('#date')
    .datetimepicker({
        onRenderMonth: function(date) {
            //Disable every other month in the year 2016
            if (date.getUTCMonth() % 2 === 0 && date.getUTCFullYear() === 2016)
                return ['disabled']
        }
    });
javascript
$('#date')
    .datetimepicker({
        onRenderHour: function(hour) {
            //Disable any time between 12:00 and 13:59
            if (date.getUTCHours() === 12 || date.getUTCHours() === 13)
                return ['disabled'];
        }
    });
javascript
$('#datetimepicker').datetimepicker('setStartDate', '2012-01-01');
javascript
$('#date-end')
    .datetimepicker()
    .on('changeDate', function(ev){
        if (ev.date.valueOf() < date-start-display.valueOf()){
            ....
        }
    });