【发布时间】:2013-12-27 05:56:59
【问题描述】:
如何将 jQuery 日期选择器转换为仅选择月份和年份?我尝试使用日期格式,它工作但也显示日期。我正在尝试一种仅选择月份和年份的方法
我写了代码,
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css">
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css">
<script>
$(function() {
$( "#datepicker" ).datepicker({dateFormat: 'MM yy'});
});
</script>
<input type="text" id="datepicker">
【问题讨论】:
标签: javascript jquery datepicker