2013-08-06 42 views
1

我使用Mootools datepicker無法在mootools的爲日期選擇器提供的maxDate選項

我輸入下面的JS文件在我的HTML

<script src="script/mootools-core.js" type="text/javascript"></script> 
<script src="script/mootools-more.js" type="text/javascript"></script> 
<script src="script/Locale.en-US.DatePicker.js" type="text/javascript"></script> 
<script src="script/Picker.js" type="text/javascript"></script> 
<script src="script/Picker.Attach.js" type="text/javascript"></script> 
<script src="script/Picker.Date.js" type="text/javascript"></script> 
<!-- <link href="styles/mooStyle.css" rel="stylesheet" /> --> 
<link href="styles/datepicker_bootstrap.css" rel="stylesheet"> 

,並用下面的代碼

window.addEvent('domready', function(){ 
    new Picker.Date($$('#endDate'),{ 
     timePicker: false, 
     positionOffset: {x: 5, y: 0}, 
     pickerClass: 'datepicker_bootstrap', 
     maxDate: {date: new Date()}, 
     useFadeInOut: !Browser.ie 
    }); 
}); 

這裏結束日期是文本框的ID。 datepicker在沒有maxdate參數的情況下正常工作。但是,當我把這個選項的日期選擇器不起作用。

使用Firebug經過和它說

TypeError: options.maxDate.clearTime is not a function 

options.maxDate.clearTime(); in Picker.Date.js (line 98) 

Picker.Date.js是來自非常久遠這個日期選擇我plugin.How可以在這個插件使用的maxDate選項的文件。

[NOTE:]請不要將jquery datepicker作爲解決方案,因爲我想爲mootools解析。

+0

是哪個datepicker?是Arian的http://mootools.net/forge/p/mootools_datepicker? – Sergio

+0

是它的阿里安的 – Abhinav

回答

1

似乎它只是沒有想到Date圍繞{date: ...}對象:

// ... 
    maxDate: new Date(), 
// ... 

the documentation,只有少數類型預期值:

的maxDate:(日期實例,字符串,默認爲null

相關問題