Jquery-ui-datepicker customization, Chinese-made, because the mobile phone layout beautiful source modification

Source: Internet
Author: User

Thanks for browsing, welcome to Exchange =. =

Company Web pages need to use Calendar control, think of Jquery-mobile, but CSS affects page layout, discard after use Jquery-ui-datepicker.

Words not much to say, into the topic:

1.jqueryui website customized download Jquery-ui.

Only take its core+datepicker only need 40kb, rejoice, because before want to use dialog function, find custom down more than 150 KB, too extravagant.

2. Code of Chinese

(function () {
$.datepicker.regional[' zh-cn ' = {
Cleartext: ' Clear ',
Clearstatus: ' Clear selected date ',
Closetext: ' Off ',
Closestatus: ' Do not change the current selection ',
Prevtext: ' < last month ',
Prevstatus: ' Show last month ',
Prevbigtext: ' << ',
Prevbigstatus: ' Show previous year ',
Nexttext: ' Next month > ',
Nextstatus: ' Show next month ',
Nextbigtext: ' >> ',
Nextbigstatus: ' Show next year ',
Currenttext: ' Today ',
Currentstatus: ' Show this month ',
MonthNames: [' January ', ' February ', ' March ', ' April ', ' May ', ' June ', ' July ', ' August ', ' September ', ' October ', ' November ', ' December ',
Monthnamesshort: [' One ', ' two ', ' three ', ' four ', ' five ', ' six ', ' VII ', ' eight ', ' IX ', ' Ten ', ' 11 ', ' 12 '],
Monthstatus: ' Select Month ',
Yearstatus: ' Select Year ',
Weekheader: ' Week ',
Weekstatus: ' Week of the Year ',
DayNames: [' Sunday ', ' Monday ', ' Tuesday ', ' Wednesday ', ' Thursday ', ' Friday ', ' Saturday '],
Daynamesshort: [' Sunday ', ' Monday ', ' Tuesday ', ' Wednesday ', ' Thursday ', ' Friday ', ' Saturday '],
Daynamesmin: [' Day ', ' one ', ' two ', ' three ', ' four ', ' five ', ' six '],
Daystatus: ' Set DD to start one week ',
Datestatus: ' Select M-D, DD ',
DateFormat: ' Yy-mm-dd ',
Firstday:1,
Initstatus: ' Please select a date ',
Isrtl:false
};
JQuery (function ($) {
$.datepicker.setdefaults ($.datepicker.regional[' ZH-CN ');
});
})();

3.mobile adaptability modification before effect:

Post-Modification effects:

1) Modify CSS style
#ui-datepicker-div {
width:80%;

Table TD A.ui-state-default {
Text-align:center;
}
}
2) Modify Jquery-ui source code:

4. You need to use the time period in the project, then make the time period plug-in

Requirements: 1) Two text boxes by DatePicker entry start date and end date respectively, the linkage effect should meet the start date < end date

2) the start date will generally have a minimum time limit

3) In the future, you may need to restrict some days to use, you can use the Beforeshowday configuration item implementation, modify the plug-in when needed

Plugin code:

Page Call:

The code is on GitHub:

All day with others open source, we also open-source bar: Https://github.com/SoulRIver2015/jquery-plugins/tree/master/mobile/river/date-picker

Jquery-ui-datepicker customization, Chinese-made, because the mobile phone layout beautiful source modification

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.