2017-10-04 27 views
0

今日の日付を無効にしたい(つまり、今日の日付は04Oct17で、これを無効にする前のすべての日付を希望しますが、前の月、年など``あなたのoptions` OBJの中で()新しい日付:あなたの日付ピッカーオプション)datepickerでtodayの前の日付を無効にする方法

$(document).ready(function() { 
    var date_input = $('input[name="date"]'); //our date input has the name "date" 
    var container = $('.bootstrap-iso form').length > 0 ? $('.bootstrap-iso form').parent() : "body"; 
    var options = { 
     format: 'mm/dd/yyyy', 
     container: container, 
     todayHighlight: true, 
     autoclose: true, 
}; 
     date_input.datepicker(options); 
}) 
+0

'MinDateプロパティを追加します。 –

答えて

0

はMinDateプロパティが

var dateToday = new Date(); // Today's Date. 
var options = { 
    format: 'mm/dd/yyyy', 
    container: container, 
    todayHighlight: true, 
    autoclose: true, 
    minDate:dateToday // <--- this will disable all date less then dateToday 
}; 
date_input.datepicker(options); 
+0

'dateToday'は何らかのjQuery UI定数ですか?私はそれに精通していない。 – j08691

+0

それは日付です。あなたは 'minDate:new Date( '1999/10/25')' –

関連する問題