jquery datepicker漢化

來源:互聯網
上載者:User

以前做項目的時候都沒有沉下心來學習,只是為了做出來而做,最近因為需要和心態的改變,所以看了一些js架構,自己對js有了較深的認識。

以後會將官方的庫修改,自己開發的東西做一個整理,以備將來項目重複利用。

找到jquery.ui.datepicker.js和jquery.ui.datepicker-zh-CN.js

將jquery.ui.datepicker.js內容

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};

替換為jquery.ui.datepicker-zh-CN.js中的

this.regional['zh-CN'] = {closeText: '關閉',prevText: '<上月',nextText: '下月>',currentText: '今天',monthNames: ['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月'],monthNamesShort: ['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月'],dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'],dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'],dayNamesMin: ['日','一','二','三','四','五','六'],weekHeader: '周',dateFormat: 'yy-mm-dd',firstDay: 1,isRTL: false,showMonthAfterYear: true,yearSuffix: '年'};

並修改

$.extend(this._defaults, this.regional['zh-CN']);

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.