Bootstrap 3 Datepicker 範例程式碼:
<!doctype html> <html> <head> <meta charset="utf-8"> <title>Bootstrap 3 Datepicker</title> <link href="css/bootstrap-datetimepicker.css" rel="stylesheet"> <link href="css/bootstrap.min.css" rel="stylesheet"> <script type="text/javascript" src="js/jquery-2.1.1.min.js"></script> <script src="js/moment-with-locales.js"></script> <script src="js/bootstrap-datetimepicker.js"></script> </head> <body> <h2>Bootstrap 3 Datepicker 日期表</h2> <h3>Using Locales</h3> <p>locale 是設定國別地區顯示語言,未設是英文. 台灣繁中 zh-tw </p> <p>其他語言,詳看 <a href="https://github.com/moment/moment/tree/develop/locale" target="_blank">https://github.com/moment/moment/tree/develop/locale</a></p> <div class="container"> <div class="row"> <div class='col-sm-6'> <div class="form-group"> <div class='input-group date' id='datetimepicker2'> <input type='text' class="form-control" /> <span class="input-group-addon"> <span class="glyphicon glyphicon-calendar"></span> </span> </div> </div> </div> <script type="text/javascript"> $(function () { $('#datetimepicker2').datetimepicker({ locale: 'zh-tw' }); }); </script> </div> </div> <h3>No Icon (input field only):</h3> <P>沒有小圖示,直接點擊輸入欄位即會顯示日期表</P> <div class="container"> <div class="row"> <div class='col-sm-6'> <input type='text' class="form-control" id='datetimepicker4' /> </div> <script type="text/javascript"> $(function () { $('#datetimepicker4').datetimepicker({ locale: 'zh-tw' }); }); </script> </div> </div> </body> </html>
範例結果:
locale 是設定國別地區顯示語言,未設是英文. 台灣繁中 zh-tw
其他語言,詳看 https://github.com/moment/moment/tree/develop/locale
沒有小圖示,直接點擊輸入欄位即會顯示日期表
My97 DatePicker 日期選擇器 範例程式碼:
<!doctype html> <html> <head> <meta charset="utf-8"> <title>喵喵笨兔 の 喵喵的家~遊戲天地 - Bootstrap 3 Datepicker 日期表簡介 & DatePicker 日期選擇器 ^^</title> <script language="javascript" type="text/javascript" src="DatePicker/WdatePicker.js"></script> </head> <body> <p> class="Wdate" 是出現日期小圖案</p> <input class="Wdate" type="text" onClick="WdatePicker()"> <font color=red>←點我彈出日期控制項</font> </body> </html>
My97 DatePicker 範例結果:
class="Wdate" 是出現日期小圖案
←點我彈出日期控制項