這裏是我到目前爲止已經試過:如何爲日期選擇器設置最小和最大日期?
Date of birth : <input id="date_of_birth" type="text" /><br />
我的Javascript代碼是這樣的:
$(function(){
$('#date_of_birth').datepicker({
monthNames: [ "Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember" ],
dayNames: [ "Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu" ],
dayNamesMin: [ "M", "S", "S", "R", "K", "J", "S" ],
//showOn: 'both',
dateFormat: 'yy-mm-dd',
changeMonth: true,
changeYear: true,
inline: true,
yearRange: '-100:-12',
});
});
演示是這樣的:http://jsfiddle.net/oscar11/8w8v9/1133/
任何解決方案來解決我的問題呢?
謝謝
我只是看着它 - 它工作正常,當你選擇日期前更改的一年。這是因爲在年份輸入下拉列表中有一個onchange處理程序,我想在沒有對所選選項進行更改的情況下,它是默認的當前年份。 – gavgrif