This time I will share jQuery Plugin and tutorial about Lightweight jQuery Date Input Picker – pickadate, hope it will help you in programming stack.
pickadate is a lightweight, fully responsive, accessible, and mobile-compatible date & time picker plugin for the web.
This is the #1 jQuery date picker plugin around the web.
Key Features:
- Mobile friendly. Supports both desktop and touch devices.
- WCAG compliant.
- Supports more than 40 languages.
- RTL supported as well.
- Tons of customization options.
- Powerful API.
How to use it :
1. Include a Pickadate theme of your choice on the page.
02 |
< link rel = "stylesheet" href = "lib/themes/pickadate.default.css" > |
04 |
< link rel = "stylesheet" href = "lib/themes/default.date.css" > |
06 |
< link rel = "stylesheet" href = "lib/themes/default.time.css" > |
09 |
< link rel = "stylesheet" href = "lib/themes/pickadate.classic.css" > |
11 |
< link rel = "stylesheet" href = "lib/themes/classic.date.css" > |
13 |
< link rel = "stylesheet" href = "lib/themes/classic.time.css" > |
16 |
< link rel = "stylesheet" href = "lib/themes/rtl.css" > |
2. Create an input field for the date & time picker.
1 |
< input id = "exampleDate" class = "datepicker" name = "date" type = "text" value = "14 August, 2014" data-value = "2014-08-08" /> |
2 |
< input id = "exampleTime" class = "timepicker" type = "time" name = "time" valuee = "2:30 AM" data-value = "0:00" /> |
3. Include jQuery library and the pickadate.js plugin’s files on your web page.
02 |
< script src = "/path/to/cdn/jquery.min.js" ></ script > |
04 |
< script src = "/path/to/lib/picker.js" ></ script > |
06 |
< script src = "/path/to/lib/picker.date.js" ></ script > |
08 |
< script src = "/path/to/lib/picker.time.js" ></ script > |
10 |
< script src = "/path/to/lib/translations/fr_FR.js" ></ script > |
12 |
< script src = "/path/to/lib/legacy.js" ></ script > |
4. Call the function on the input filed and one.
2 |
$( '.datepicker' ).pickadate(); |
5 |
$( '.timepicker' ).pickatime(); |
5. Possible options for the date picker.
01 |
$( '.datepicker' ).pickadate({ |
03 |
labelMonthNext: 'Next month' , |
04 |
labelMonthPrev: 'Previous month' , |
07 |
labelMonthSelect: 'Select a month' , |
08 |
labelYearSelect: 'Select a year' , |
11 |
monthsFull: [ 'January' , 'February' , 'March' , 'April' , 'May' , 'June' , 'July' , 'August' , 'September' , 'October' , 'November' , 'December' ], |
12 |
monthsShort: [ 'Jan' , 'Feb' , 'Mar' , 'Apr' , 'May' , 'Jun' , 'Jul' , 'Aug' , 'Sep' , 'Oct' , 'Nov' , 'Dec' ], |
13 |
weekdaysFull: [ 'Sunday' , 'Monday' , 'Tuesday' , 'Wednesday' , 'Thursday' , 'Friday' , 'Saturday' ], |
14 |
weekdaysShort: [ 'Sun' , 'Mon' , 'Tue' , 'Wed' , 'Thu' , 'Fri' , 'Sat' ], |
29 |
format: 'd mmmm, yyyy' , |
34 |
table: prefix + 'table' , |
36 |
header: prefix + 'header' , |
38 |
navPrev: prefix + 'nav--prev' , |
39 |
navNext: prefix + 'nav--next' , |
40 |
navDisabled: prefix + 'nav--disabled' , |
42 |
month: prefix + 'month' , |
43 |
year: prefix + 'year' , |
45 |
selectMonth: prefix + 'select--month' , |
46 |
selectYear: prefix + 'select--year' , |
48 |
weekdays: prefix + 'weekday' , |
51 |
disabled: prefix + 'day--disabled' , |
52 |
selected: prefix + 'day--selected' , |