timepicker jquery 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: timepicker in jquery

<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/timepicker/1.3.5/jquery.timepicker.min.css">

Example 3: jquery timepicker

$('.timepicker').timepicker({
    timeFormat: 'h:mm p',
    interval: 15,
    minTime: '10',
    maxTime: '6:00pm',
    defaultTime: '11',
    startTime: '10:00',
    dynamic: false,
    dropdown: true,
    scrollbar: true
});

Example 4: how to use jquery timepicker

$('.timepicker').timepicker({
    timeFormat: 'h:mm p',
    interval: 60,
    minTime: '10',
    maxTime: '6:00pm',
    defaultTime: '11',
    startTime: '10:00',
    dynamic: false,
    dropdown: true,
    scrollbar: true
});

Tags:

Misc Example