Web APP Date Selection control

Source: Internet
Author: User

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 styledatepicker.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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.