如何限制日期选择器的最大日到今天? [英] How to limit datepicker's max date to today?
问题描述
该问题是在标题。我有两个datepickers,从而至。我希望限制从日期选择为当前日期。我怎么做?在此先感谢!
The questions is in the Title. I have two datepickers, from and to. I want to limit the from datepicker to the current date. How do I do that? Thanks in advance!
推荐答案
使用的MAXDATE选项:<一个href=\"http://jqueryui.com/demos/datepicker/#option-maxDate\">http://jqueryui.com/demos/datepicker/#option-maxDate
Use the maxDate options : http://jqueryui.com/demos/datepicker/#option-maxDate
通过Date对象或作为一个字符串设置最大可选日期
当前DATEFORMAT或数量从今天天(例如+7)或
值和周期的串('y'表示年,M为月,'w'表示
周,D为天,例如'+超过100万1瓦特'),或者为null,没有任何限制。
Set a maximum selectable date via a Date object or as a string in the current dateFormat, or a number of days from today (e.g. +7) or a string of values and periods ('y' for years, 'm' for months, 'w' for weeks, 'd' for days, e.g. '+1m +1w'), or null for no limit.
例如: $(.selector).datepicker(选项,MAXDATE,新的Date());
这篇关于如何限制日期选择器的最大日到今天?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!