JQuery日期選取器外掛程式date-input,jquerydate-input

來源:互聯網
上載者:User

JQuery日期選取器外掛程式date-input,jquerydate-input

                                                JQuery日期選取器外掛程式之date-input


官方網站:http://jonathanleighton.com/projects/date-input/

http://github.com/jonleighton/date_input/raw/master/jquery.date_input.js

http://github.com/jonleighton/date_input/raw/master/date_input.css

中文支援:

[javascript] view plaincopy
  1. jQuery.extend(DateInput.DEFAULT_OPTS, {  month_names: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],  short_month_names: ["一", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二"],  short_day_names: ["一", "二", "三", "四", "五", "六", "日"]});  

說明:預設是日期格式很不好,可以根據需求修改。

全部代碼如下:

[html] view plaincopy
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
  2. <html xmlns="http://www.w3.org/1999/xhtml">  
  3. <head>  
  4. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />  
  5. <title>日曆</title>  
  6. <script type="text/javascript" src="jquery-1.3.2.js"></script>   
  7. <script type="text/javascript" src="jquery.date_input.js"></script>   
  8. <link rel="stylesheet" href="date_input.css" type="text/css">   
  9. <script>  
  10. jQuery.extend(DateInput.DEFAULT_OPTS, {   
  11. month_names: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],   
  12. short_month_names: ["一", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二"],   
  13. short_day_names: ["一", "二", "三", "四", "五", "六", "日"],  
  14.  dateToString: function(date) {  
  15.     var month = (date.getMonth() + 1).toString();  
  16.     var dom = date.getDate().toString();  
  17.     if (month.length == 1) month = "0" + month;  
  18.     if (dom.length == 1) dom = "0" + dom;  
  19.     return date.getFullYear() + "-" + month + "-" + dom;  
  20.   }  
  21.   
  22. });   
  23.   
  24. $(function() {   
  25. $(".biuuu1").date_input();   
  26. $(".biuuu2").date_input();   
  27. });   
  28. </script>  
  29. </head>  
  30.   
  31. <body>  
  32. <input type="text" class="biuuu1" name="date"/>   
  33. <input type="text" class="biuuu2" name="date"/>   
  34. </body>  
  35. </html>  

樣本圖:
 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.