6 ส.ค. 2558

Jquery plugin create calendar Thailand the datepicker.

1. Download Jquery Plugin And add
  1. <script src="js/jqueryui_datepicker_thai.js"></script>  
2. add
  1. <?php    
  2. $jquery_ui_v="1.8.5";    
  3. $theme=array(    
  4.     "0"=>"base",    
  5.     "1"=>"black-tie",    
  6.     "2"=>"blitzer",    
  7.     "3"=>"cupertino",    
  8.     "4"=>"dark-hive",    
  9.     "5"=>"dot-luv",    
  10.     "6"=>"eggplant",    
  11.     "7"=>"excite-bike",    
  12.     "8"=>"flick",    
  13.     "9"=>"hot-sneaks",    
  14.     "10"=>"humanity",    
  15.     "11"=>"le-frog",    
  16.     "12"=>"mint-choc",    
  17.     "13"=>"overcast",    
  18.     "14"=>"pepper-grinder",    
  19.     "15"=>"redmond",    
  20.     "16"=>"smoothness",    
  21.     "17"=>"south-street",    
  22.     "18"=>"start",    
  23.     "19"=>"sunny",    
  24.     "20"=>"swanky-purse",    
  25.     "21"=>"trontastic",    
  26.     "22"=>"ui-darkness",    
  27.     "23"=>"ui-lightness",    
  28.     "24"=>"vader"    
  29. );    
  30. $jquery_ui_theme=$theme[22];    
  31. ?>    
  32. <link type="text/css" rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/<?=$jquery_ui_v?>/themes/<?=$jquery_ui_theme?>/jquery-ui.css" />    
  33. <style type="text/css">    
  34. /* ปรับขนาดตัวอักษรของข้อความใน tabs   
  35. สามารถปรับเปลี่ยน รายละเอียดอื่นๆ เพิ่มเติมเกี่ยวกับ tabs  
  36. */    
  37. .ui-tabs{    
  38.     font-family:tahoma;    
  39.     font-size:11px;    
  40. }    
  41. </style>    
  42. <style type="text/css">  
  43. /* Overide css code กำหนดความกว้างของปฏิทินและอื่นๆ */  
  44. .ui-datepicker{  
  45.     width:220px;  
  46.     font-family:tahoma;  
  47.     font-size:11px;  
  48.     text-align:center;  
  49. }  
  50. </style>  
3. add
  1. <input name="dateInput" type="text" id="dateInput3" value="" />  
4. add
  1. <script src="js/jquery.min.js"></script>  
  2. <script src="js/jquery-ui.min.js"></script>  
  3. <script src="js/jqueryui_datepicker_thai.js"></script>  
  4. <script type="text/javascript">  
  5. $(function(){  
  6. $("#dateInput").datepicker({  
  7.         dateFormat: 'dd-mm-yy',  
  8.         showOn: 'button',    
  9.         buttonImageOnly: false,  
  10.         changeMonth: true,  
  11.         changeYear: true,
  12.         yearRange: "1900:2015 "
  13.     });       
  14. });  
  15. </script> 

Credit : http://www.ninenik.com/

ไม่มีความคิดเห็น:

แสดงความคิดเห็น