Struts2 JQuery日期选择器:将maxDate设置为今天

Struts2 JQuery日期选择器:将maxDate设置为今天,jquery,struts2,datepicker,struts2-jquery,struts2-jquery-plugin,Jquery,Struts2,Datepicker,Struts2 Jquery,Struts2 Jquery Plugin,我希望将maxDate设置为当前日期 我试过了,但还是有问题 这是我的密码: <sj:datepicker id = "dob" name = "dateOfBirth" label = "Date Of Birth" changeMonth = "true" changeYear = "true" yearRange = "1980" maxD

我希望将
maxDate
设置为当前日期

我试过了,但还是有问题

这是我的密码:

<sj:datepicker id = "dob"        
             name = "dateOfBirth" 
            label = "Date Of Birth" 
      changeMonth = "true"  
       changeYear = "true"    
        yearRange = "1980" 
          maxDate = "0"      
         readonly = "true" />

使用



或者从getter返回
new Date()
,并使用链接的另一个答案中的代码。

非常感谢Andrea帮助解决了我的问题。通过使用上面的struts2日期选择器代码,日历显示正确,并且我使用相同的代码设置maxDate=“0”,但它不会隐藏未来的日期。解决方案==>日历应显示到今天,并且应禁用即将/未来日期。当我将timepicker=“true”与相同的代码一起使用时,maxDate=“0”和解除对未来日期的锁定都可以正常工作。但是我需要附加代码maxDate=“0”的解决方案,应该可以工作。非常感谢Andrea的可能副本。现在,它可以与您的代码一起工作。你能帮我解决我的另一个问题吗?因为我在过去两天被卡住了。我需要使用struts2 jquery datepicker的解决方案如何只启用日历中的特定日期剩余的所有其他日期都应禁用。甚至我尝试使用struts2 jquery datepicker使用onCompleteTopics和onBeforeShowDayTopics。不使用struts2,我可以在这里得到解决方案==>。使用struts2 jquery datepicker也需要同样的东西。请帮我解决我的问题。