0
イベント後に日付形式を変更する同じIDでJquery日付ピッカーを取得しようとしています。私はコードスニペットの下で試しましたが、期待どおりに実行することができませんでした。同じIDのJquery日付ピッカーの異なる2つの日付形式
JSはCODE
function dateselect(){
var type = jQuery('#uploadtype').val()
if(type == "monthly"){ //if user select month as dropdown
jQuery('#datepicker').datepicker({
changeMonth: true,
changeYear: true,
showButtonPanel: true,
dateFormat: 'MM yy',
onClose: function(dateText, inst) {
$(this).datepicker('setDate', new Date(inst.selectedYear, inst.selectedMonth, 1));
}
});
}
else{
jQuery('#datepicker').datepicker({
beforeShowDay: displayValidDates,
maxDate: '-1w',
constrainInput: true,
dateFormat:"yy-mm-dd"
});
}
}