admin管理员组文章数量:1332389
According to Telerik's documentation, to set a RadDatePicker's mindate or maxdate properties client-side, you are to use the two methods set_minDate() and set_maxDate() respectively. I initially thought that simply passing in null into these methods would remove any constraints on the controls, but it does not seem to be the case. Does anyone have experience clearing these properties for the RadDatePicker client-side?
Thanks!
According to Telerik's documentation, to set a RadDatePicker's mindate or maxdate properties client-side, you are to use the two methods set_minDate() and set_maxDate() respectively. I initially thought that simply passing in null into these methods would remove any constraints on the controls, but it does not seem to be the case. Does anyone have experience clearing these properties for the RadDatePicker client-side?
Thanks!
Share asked Oct 30, 2009 at 19:13 Dan AppleyardDan Appleyard 7,44514 gold badges51 silver badges80 bronze badges 1- Have you tried just using a far in the past or far in the future date respectively? If you are using SQL Server datetime for example it doesn't like certain dates, like 1,000,000 AD so I'm not sure you would want that anyway, it depends on your domain. – Jarrett Widman Commented Oct 30, 2009 at 19:17
1 Answer
Reset to default 6Definitely don't pass null
to those methods, you'll get a TypeError
exception thrown ;)
When you omit MinDate
and MaxDate
from your markup, telerik internally defaults the client to new Date(1980, 0, 1)
and new Date(2099, 11, 31)
respectively. (Note: this happens in the constructor code of Telerik.Web.UI.RadDateInput
).
So the trick to "clearing" those properties is to set them back to those defaults:
$find('RadDateTimePicker').set_minDate(new Date(1980, 0, 1));
$find('RadDateTimePicker').set_maxDate(new Date(2099, 11, 31));
I know it feels wrong to do it this way, but it is the method that most closely matches what telerik does internally anyway. (Plus, telerik will ignore anything else you pass to it, eg 0
, null
, ""
, etc)
本文标签: javascriptClear the MinMax dates of RadDatePicker clientsideStack Overflow
版权声明:本文标题:javascript - Clear the MinMax dates of RadDatePicker client-side? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742291077a2447808.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论