Jquery datepicker Localization

Source: Internet
Author: User

I did not learn it in my previous project. I just did it for my own purpose. Recently, I have read some JS frameworks because of my changing needs and mentality, I have a deep understanding of Js.

In the future, the official library will be modified and the items developed by myself will be organized for reuse in future projects.

Find jquery. UI. datepicker. js and jquery. UI. datepicker-zh-CN.js

Set jquery. UI. datepicker. js content

this.regional[''] = { // Default regional settingscloseText: 'Done', // Display text for close linkprevText: 'Prev', // Display text for previous month linknextText: 'Next', // Display text for next month linkcurrentText: 'Today', // Display text for current month linkmonthNames: ['January','February','March','April','May','June','July','August','September','October','November','December'], // Names of months for drop-down and formattingmonthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formattingdayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formattingdayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formattingdayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at SundayweekHeader: 'Wk', // Column header for week of the yeardateFormat: 'yyyymmdd', // See format options on parseDatefirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...isRTL: false, // True if right-to-left language, false if left-to-rightshowMonthAfterYear: false, // True if the year select precedes month, false for month then yearyearSuffix: '' // Additional text to append to the year in the month headers};

Replace

This. regional ['zh-cn'] = {closetext: 'close', prevtext: '<last month', nexttext: 'Next month> ', currenttext: 'Today', monthnames: ['October ', 'October ', 'October ', 'October', 'October '], monthnamesshort: ['October', 'October ', 'August 22, ', 'August 22,', 'August 22, ', 'August 22,'], daynames: ['sunday', 'monday', 'tuesday ', 'wedday', 'thurday', 'Friday', 'saturday'], daynamesshort: ['sunday', 'monday', 'tues', 'wedday', 'thurday ', 'Friday', 'satur'], daynamesmin: ['day', 'yi', '2', '3', '4', '5 ', '6'], weekheader: 'Week', dateformat: 'yy-mm-dd', firstday: 1, isrtl: false, showmonthafteryear: True, yearsuffix: 'Year '};

And modify

$. Extend (this. _ defaults, this. Regional ['zh-cn']);

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.