We recommend a useful date selection box component to select the time range CustomPeriodUI

Source: Internet
Author: User

Make a small button and click it, as shown in the next small bullet box.

 

Date and time can be selected

Source code

[Javascript]
Var avg_fdate = "", avg_tdate = "", selperiod = console. constants. HRS12, fdate = "", tdate = "";
Var avg_button = new Ext. Button ({
Icon: '/ico/date.png ',
Cls: 'x-btn-icon ',
Tooltip :{
Text: _ ('<B> Select time range </B> <br/> ')
},
Handler: function (){
Var avg = new CustomPeriodUI (_ ("Select time range"), fdate, tdate, selperiod );
Var avg_window = avg. getWindow ();
Var btn = new Ext. Button ({
Id: 'avg _ click ',
Text: _ ('OK '),
Listeners :{
Click: function (btn ){
If (avg. validate ()){
Avg_00000000hide (); www.2cto.com
Avg_fdate = avg. fromTime ();
Avg_tdate = avg. toTime ();
Fdate1 = formatDate (new Date (avg_fdate); // convert the Date Format
Tdate1 = formatDate (new Date (avg_tdate ));
}
}
}
});
Avg_00000000addbutton (btn );
Avg_00000000show ();
}
});
It's easy.

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.