【发布时间】:2014-04-14 13:17:35
【问题描述】:
我的页面中有以下JQuery Datepicker。
$("#<%= txtDate.ClientID %>").datepicker({
changeMonth: true,
changeYear: true,
dateFormat: "dd-mm-yy",
yearRange: '1901:2050',
maxDate: new Date(),
showOn: "button",
buttonImage: "images/calendar.png",
buttonImageOnly: true,
showButtonPanel: true,
showMonthAfterYear: true,
inline: true,
altField: "#<%= HiddenDate.ClientID %>",
altFormat: "dd-mm-yy",
onSelect: function (dateText, inst) {
shouldsubmit = true;
javascript: __doPostBack('<%= txtDate.ClientID %>', '');
},
onClose: function (dateText, inst) {
shouldsubmit = false;
}
});
它将我的选择限制在当前日期。如何允许用户选择任何未来的日期?
【问题讨论】:
-
new Date()为您提供今天的日期。所以说你可以选择的最后一天是今天。
标签: jquery datepicker