How To Add Date Time Picker Input Field Jquery

How To Add Date Time Picker Input Field Jquery

How To Add Date Time Picker Input Field Jquery

0 Sales

Free

In case you are scanning for a jQuery module to add date-time picker to data field, this article will help you with lotting for that. DateTimePicker jQuery module is uncommonly direct and easy to complete. Furthermore, this module gives various choices to alter your Date-Time Picker as indicated by your undertaking needs.

This instructional exercise exhibits the least troublesome way to deal with incorporate date time picker with inconsequential JavaScript code. Here two sorts of date-time picker would be shown. One will appear on tapping the data field and another would be indicated inline.

Before using jQuery DateTimePicker, consolidate the jQuery library.

<script src="jquery.min.js"></script>

By and by fuse the js and css records of DateTimePicker module. This js record should seek after the <body> tag.

<link rel="stylesheet" type="text/css" href="jquery.datetimepicker.css"/>
<script src="jquery.datetimepicker.full.js"></script>

HTML Code

<input type="text" id="datetimepicker"/>

JavaScript Code

$('#datetimepicker').datetimepicker({
    format:'Y-m-d H:i',
});

Inline DateTimePicker:

$('#datetimepicker').datetimepicker({
    format:'Y-m-d H:i',
    inline:true
});

Options

Most Commonly Used Customization Choices Are Given Underneath.

MinDate & MaxDate:

$('#datetimepicker3').datetimepicker({
    format:'Y-m-d H:i',
    minDate:'2016-04-05',
    maxDate:'2016-04-28'
});

For today use minDate:0.

MinTime & MaxTime:

$('#datetimepicker4').datetimepicker({
    format:'Y-m-d H:i',
    minTime:'09:00',
    maxTime:'20:00'
});

For today use minTime:0.

Step Time:

$('#datetimepicker5').datetimepicker({
    format:'Y-m-d H:i',
    step:15
});

On Select Date:

$('#datetimepicker6').datetimepicker({
    format:'Y-m-d H:i',
    onSelectDate:function(current_time, $input){
        var selectedDate = $input.val();
        alert(selectedDate);
    }
});

On Select Time:

$('#datetimepicker7').datetimepicker({
    format:'Y-m-d H:i',
    onSelectTime:function(current_time, $input){
        var selectedDate = $input.val();
        alert(selectedDate);
    }
});

Conclusion

 

The essential inspiration driving this instructional exercise is to give the minute way to deal with add date-time picker to information structure field.

LICENSE OF USE

You can use it for personal or commercial projects. You can't resell it partially or in this form.

PRODUCT INFO

Create Date : May 14, 2020

Updated Date : May 14, 2020

Ratings

Comments : 0

Downloads : 0