Mint UI DateTimePicker Mobile-side jquery DateTimePicker Summary Application

Source: Internet
Author: User

How to use the Datatimepicker using the Minit UI for mobile phone-side DateTimePicker

First of all, it needs two triggers here because the project uses the start-to-finish time, I manually passed in a parameter when I clicked.

And declare this method in the methods of Vue.

Openpicker (type) {        this.type=type;        this. $refs. Picker.open ();      },

Here I accept the arguments passed at the time of the click to determine whether I clicked the start or end, and then click OK to trigger an event handleconfirm

Handleconfirm (data) {Let        date = Moment (data). Format (' Yyyy-mm-dd ');        if (this.type== ' start ') {          this.starttime = date;        }        if (This.type = = ' End ') {          this.endtime = date;        }      }

Click OK and then I will pass the clicked content to input in the time must be formatted, because the unit lets wear the format is YYYY-MM-DD so we have to format the parameters of the

It is recommended to use Moment.js

Import moment from ' moment '

The corresponding document address is http://momentjs.cn/docs/so that you can add to the parameters of the time we want in our advance input tag the option to complement the component

<mt-datetime-picker      v-model= "pickervisible"      type= "date"      ref= "picker"      year-format= "{value} Year "      month-format=" {value} month "      date-format=" {value} day "      @confirm =" Handleconfirm "      : StartDate = ' Maxdata '      : endDate = ' mindata '      >    </mt-datetime-picker>

For friends who don't use Vue, I recommend a very good jquery plugin for a mobile phone.

Link: Https://pan.baidu.com/s/1pLyuN6F Password: yoq5

Understand JS to enter the Date.js can adjust its options like Minit UI style

Mint UI DateTimePicker Mobile-side jquery DateTimePicker Summary Application

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.