找到你要的答案

Q:JQuery datepicker pick date in next 7 days

Q:jQuery DatePicker选择日期,在接下来的7天

I am using JQuery date picker and want to choose a date between today's date and the next 7 days. I have it working so I can only choose a date from today on wards. I want to be able choose a date only in the next 7 days.

$('#datepairExample .date').datepicker({ // initializing datepicker
   startDate : "0d",
   format : "d/m/yyyy"
});

I am guessing there is an endDate like I have used startDate above.

我使用jQuery Date-picker想选择今天的日期和未来7天之间的日期。我有它的工作,所以我只能选择一个日期从今天的病房。我只想在接下来的7天里选择一个日期。

$('#datepairExample .date').datepicker({ // initializing datepicker
   startDate : "0d",
   format : "d/m/yyyy"
});

我想有一个像我用上面的开始日期结束日期。

answer1: 回答1:

Please, note that startDate and format don't exist: see the available options on documentation.

Try maxDate, minDate, and dateFormat:

$('#datepairExample .date').datepicker({ // initializing datepicker
   minDate: 0,
   maxDate: "7d", // or: maxDate: "1w",
   dateFormat: "d/m/yyyy"
});

请注意,日期和格式不存在:见文件选项。

试着maxdate,mindate,和日期格式:

$('#datepairExample .date').datepicker({ // initializing datepicker
   minDate: 0,
   maxDate: "7d", // or: maxDate: "1w",
   dateFormat: "d/m/yyyy"
});
jquery  datepicker