我有一个 Bootstrap 的日期选择器,我试图能够修改网址单击下一个月箭头或前一个月箭头。
Datepicker example
当我在日历上选择某一天时,URL会发生变化,但我也不知道如何通过单击箭头来更改URL。
我的datepicker.js文件看起来像这样:
$(function(){
$('#datetable')
.datepicker({
format: "dd/mm/yyyy",
todayHighlight: true,
clearBtn: true,
daysOfWeekDisabled: [0, 6],
daysOfWeekHighlighted: "0,6",
changeMonth: false
})
.change(function() {
let pickedDate = $("input").val();
if (pickedDate){
$("#showdate").text(
`You picked ${pickedDate}.`);
var date = $('#datetable').datepicker('getDate');
day = date.getDate(date);
month = date.getMonth(date) + 1;
year = date.getFullYear(date);
window.location.assign("https://bloxool-simple.testing.com.co/test/helloworld.php&year=" + year + "&month=" + month + "&day=" + day);
} else {
$("#showdate").text(
`No date chosen.`);
}
});
});
非常感谢你的帮助
1条答案
按热度按时间col17t5w1#