JQUERY日期选择器周和年
我需要datepicker将周和年添加到url中,我目前已将其用于周,但我不确定如何为年添加第二个参数 我需要这样显示:?周=10年=2019年 非常感谢您的帮助JQUERY日期选择器周和年,jquery,Jquery,我需要datepicker将周和年添加到url中,我目前已将其用于周,但我不确定如何为年添加第二个参数 我需要这样显示:?周=10年=2019年 非常感谢您的帮助 $(function () { $("#datepicker").datepicker({ onSelect: function(dateText, inst) { inst.input.val($.datepicker.iso8601Week(new Date(dateText))
$(function () {
$("#datepicker").datepicker({
onSelect: function(dateText, inst) {
inst.input.val($.datepicker.iso8601Week(new Date(dateText)));
window.open(window.location.pathname + '?week=' + this.value, "_self");
}
});
});
可以使用日期的getFullYear()函数
$(函数(){
$(“#日期选择器”)。日期选择器({
onSelect:函数(日期文本,inst){
inst.input.val($.datepicker.iso8601Week(新日期(dateText));
var year=新日期(dateText).getFullYear();
警报(window.location.pathname+'?week='+this.value+“&year=“+year”)
window.open(window.location.pathname+'?week='+this.value+“&year=“+year+this.value”“”);
}
});
} );代码>
jQuery UI日期选择器-默认功能
日期:
你会拉小提琴吗?