datetimepicker() code example

Example 1: datetimepicker jquery

############### JS ##############  
1. npm i jquery-datetimepicker

2. Include inside js file

import "jquery-datetimepicker";

$('#datetimepicker').datetimepicker();

############## CSS ###################

3. Include inside css/scss file

@import "jquery-datetimepicker/build/jquery.datetimepicker.min.css";

Example 2: bootstrap datetime picker

<div class="container">
    <div class="row">
        <div class='col-sm-6'>
            <div class="form-group">
                <div class='input-group date' id='datetimepicker2'>
                    <input type='text' class="form-control" />
                    <span class="input-group-addon">
                        <span class="glyphicon glyphicon-calendar"></span>
                    </span>
                </div>
            </div>
        </div>
        <script type="text/javascript">
            $(function () {
                $('#datetimepicker2').datetimepicker({
                    locale: 'ru'
                });
            });
        </script>
    </div>
</div>

Example 3: bootstrap datetime picker

<div class="container">
    <div class="row">
        <div class='col-sm-6'>
            <div class="form-group">
                <div class='input-group date' id='datetimepicker1'>
                    <input type='text' class="form-control" />
                    <span class="input-group-addon">
                        <span class="glyphicon glyphicon-calendar"></span>
                    </span>
                </div>
            </div>
        </div>
        <script type="text/javascript">
            $(function () {
                $('#datetimepicker1').datetimepicker();
            });
        </script>
    </div>
</div>

Example 4: datetimepicker

<div class="input-append date" id="datetimepicker" data-date="12-02-2012" data-date-format="dd-mm-yyyy">    <input class="span2" size="16" type="text" value="12-02-2012">    <span class="add-on"><i class="icon-remove"></i></span>    <span class="add-on"><i class="icon-th"></i></span></div>

Example 5: datetimepicker

$('#datetimepicker').datetimepicker('remove');