Calendar Date Picker Component Tui - Free Download Convenient Calendar & Date Picker Component - jQuery tui.date-picker

Free Download Convenient Calendar & Date Picker Component – jQuery tui.date-picker

Posted on

This time I will share jQuery Plugin and tutorial about Convenient Calendar & Date Picker Component – jQuery tui.date-picker, hope it will help you in programming stack.

Calendar Date Picker Component Tui - Free Download Convenient Calendar & Date Picker Component - jQuery tui.date-picker
File Size: 301 KB
Views Total: 2553
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

tui.date-picker is an easy-to-use, user-friendly, multi-language, highly customizable calendar, time/date/month/year picker and date range picker component implemented in jQuery.

Features:

  • Calendar mode: inline calendar
  • Datepicker mode: time/date/month/year picker
  • DaterangePicker mode: allows you to select a date range.

How to use it:

1. Install & download the tui.date-picker via NPM.

1 # NPM
2 $ npm install tui-date-picker --save

2. Import the tui.date-picker.

1 // ES 6
2 import {DatePicker} from 'tui-date-picker';

3. Or directly include the compiled & minified version of the the tui.date-picker component on the webpage.

1 <link href="/path/to/tui-date-picker.css" rel="stylesheet">
2 <script src="/path/to/jquery.min.js"></script>
3 <script src="/path/to/tui-code-snippet.min.js"></script>
4 <script src="/path/to/tui-date-picker.js"></script>

4. Include the tui.time-picker component in case you want to display a time picker inside the date picker.

1 <link href="/path/to/tui-time-picker.css" rel="stylesheet">
2 <script src="/path/to/tui-time-picker.js"></script>

5. Append the date picker to an input field.

1 <div class="tui-datepicker-input tui-datetime-input tui-has-focus">
2   <input type="text" id="datepicker-input" aria-label="Date-Time">
3   <span class="tui-ico-date"></span>
4 </div>
5 <div id="example"></div>
1 const myDatepicker = new tui.DatePicker('#example', {
2       date: new Date(),
3       input: {
4         element: '#datepicker-input'
5       }
6 });

6. Create an inline calendar using the createCalendar API.

1 <div id="calendar-example"></div>
1 var DatePicker = tui.DatePicker;
2 var myCalendar = DatePicker.createCalendar('#calendar-example');

7. Create a date range picker using the createRangePicker API.

01 <div class="tui-datepicker-input tui-datetime-input tui-has-focus">
02   <input id="startpicker-input" type="text" aria-label="Date">
03   <span class="tui-ico-date"></span>
04   <div id="startpicker-container"></div>
05 </div>
06  
07 <span>to</span>
08  
09 <div class="tui-datepicker-input tui-datetime-input tui-has-focus">
10   <input id="endpicker-input" type="text" aria-label="Date">
11   <span class="tui-ico-date"></span>
12   <div id="endpicker-container"></div>
13 </div>
01 var today = new Date();
02 var picker = tui.DatePicker.createRangePicker({
03     startpicker: {
04         date: today,
05         input: '#startpicker-input',
06         container: '#startpicker-container'
07     },
08     endpicker: {
09         date: today,
10         input: '#endpicker-input',
11         container: '#endpicker-container'
12     },
13     selectableRanges: [
14         [today, new Date(today.getFullYear() + 1, today.getMonth(), today.getDate())]
15     ]
16 });

8. Possible options for the DatePicker API.

01 // options and defaults
02 const myDatepicker = new tui.DatePicker('#example', {
03  
04       // language
05       language: 'en'
06  
07       // calendar options (see below)
08       calendar: {},
09  
10       // element: input element
11       // format: date format
12       input: {
13         element: null,
14         format: null
15       },
16  
17       // enable/disable timepicker
18       timepicker: null,
19  
20       // initial date
21       date: null,
22  
23       // always show the date picker
24       showAlways: false,
25  
26       // 'date', 'month', 'year'
27       type: 'date',
28  
29       // selectable date ranges
30       selectableRanges: null,
31  
32       // opener button list
33       openers: [],
34