GitHub Address: Https://github.com/yuanzm/simple-date-picker#simple-date-pickerSimple-date-picker
Zepto-based mobile lightweight date plug-in
Installation
The following two ways are supported
- git clone directly after copying the reference Bin folder below
datepicker.min.css
anddatepicker.min.js
- Download the installation from NPM:
npm install --save date_picker
Use
- Reference style
datepicker.min.css
- Reference
datepicker.min.js
or reference modulevar DatePicker = require(‘date_picker‘);
- Instantiating a component, binding the plug-in after the date selection is complete callback function
var _date = document.getElementById(‘date‘);var datePicker = new DatePicker({confirmCbk: function(data) { _date.value = data.year + ‘-‘ + data.month + ‘-‘ + data.day;}}); _date.onfocus = function(e) { _date.blur();datePicker.open(); };
Plug-in external two API: open
and close
, especially note that the above demo in the _date after the focus to remove the focus, is to avoid Android under the input tag set ReadOnly property does not prohibit the native keyboard pop-up problem.
Online Demo
Reference: https://www.cnblogs.com/yuanzm/p/5241323.html
Web APP Date Selection control