2017-02-08 112 views
0

我正在尋找一個jQuery datepicker插件,可以「餵養」可用日期。最佳日期選擇器用於餵食'可選'日期

示例輸入: 22-01-2017 23-01-2017 28-01-2017 2017年2月2日

輸出: -a日期選擇器只允許的日期從例如輸入。

Daterange在這裏不會真的有效,因爲某些日期可能會被跳過。有誰知道一個(可定製的)jQuery插件,允許這?

在此先感謝!

回答

2

看看我的插件在這裏:https://codecanyon.net/item/caleran-date-range-picker/19454049

還有的在插件中disableDays過濾器,你可以用它向後,使你想要的日子。

像這樣:

<script type="text/javascript"> 
    $("#caleran").caleran({ 
    disableDays: function(day){ 
     var enabledDays = [ 
     moment("22-01-2017", "DD-MM-YYYY"), 
     moment("23-01-2017", "DD-MM-YYYY"), 
     moment("28-01-2017 ", "DD-MM-YYYY"), 
     moment("02-02-2017", "DD-MM-YYYY") 
     ]; 
     return $.grep(enabledDays, function(d){ return d.isSame(day,"day"); }).length > 0; 
    } 
    }); 
</script> 

演示在這裏:http://rettica.com/caleran/docs/readme.html#custom-disabled-ranges-with-callback-

相關問題