2014-02-10 54 views
1

我在我的項目中使用jQuery Datepicker。在那裏,我有要求,我必須顯示所有月份,類似於我們通常顯示的日期。jQuery Date Picker只顯示月份

我在網上搜索,但我發現在datepicker下拉只有幾個月。但那不符合我的要求。有沒有人使用日期選擇器來顯示唯一的月份和年份。

<!doctype html> 
<html lang="en"> 
<head> 
    <meta charset="utf-8"![enter image description here][2]> 
    <title>jQuery UI Datepicker - Default functionality</title> 
    <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css"> 
    <script src="//code.jquery.com/jquery-1.9.1.js"></script> 
    <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script> 
    <link rel="stylesheet" href="/resources/demos/style.css"> 
    <script> 
    $(function() { 
    $("#datepicker").datepicker(); 
    }); 
    </script> 
</head> 
<body> 

<p>Date: <input type="text" id="datepicker"></p> 


</body> 
</html> 

一些這樣的事 enter image description here

+0

http://jsfiddle.net/bopperben/DBpJe/ –

+0

請檢查該圖片,我期待像這樣 – PCA

+0

http://jsfiddle.net/yLjDH/ – Sandy

回答

2

您可以通過jQuery的月選擇插件使用此鏈接Month link