【发布时间】:2012-04-25 13:30:10
【问题描述】:
我有一个 jquery datepicker 设置。我已经对此进行了自定义,以便在 datepicker div 中创建了一个自定义菜单,其中包含几个月的时间,如下所示:
<div class="custom_menu">
<div class="month">January 2012</div>
<div class="month">February 2012</div>
<div class="month">March 2012</div>
</div>
我想要做的是当用户点击一个月份时,我希望日期选择器用那个月份更新它的视图,例如一些伪代码
$('.month').live('click', function(){
var newmonth = $(this).text(); //get the month in a suitable format
$('#current_datpicker').update('month', newmonth); //update the datepicker to show this month
});
我可以这样做吗,查看 API 文档没有显示任何内容...
编辑
我面临的问题是当我在页面上有超过 1 个日期选择器实例时如何获取 #current_datepicker(即正确的日期选择器 ID)?当前的日期选择器触发器输入 ID 是否存储在某处?
【问题讨论】:
标签: jquery datepicker