這被標記爲較早的重複,我沒有得到任何答案。這不是重複的,所以請不要將它標記爲,另一篇文章涉及到限制第二個日期到第一個選擇中的當前選定日期,我沒有試圖這樣做,已經有了。我正在嘗試將+3天添加到第二個日曆/日期。因此,如果我選擇今天的第一天和第二天的日期,我不應該從該日期+3天內選擇日期。在jQuery UI中將第二個日期限制爲+日期日期選擇器
例:從日期爲21/12/2016然後在第二個字段我不能選擇然後24/12/2016較早的日期。
我在datepicker中遇到日期範圍問題。我需要在選定的「carrental_from_date」後至少3天有「carrental_to_date」,但似乎沒有任何工作。
我試圖對「TO_DATE」到「+ 3D」,但它並不似乎挑選了改變「的minDate」,我發現這個在這裏一個例子:http://jsfiddle.net/jquerybyexample/dxbtp/494/,但我沒能拿到工作。不知道我在這裏做錯了什麼,並希望你們中的一位天才能夠指引我朝着正確的方向前進。
jQuery('#carrental_from_date' + element_id).datepicker({
//showOn: "both",
beforeShow: carrental_customRange,
dateFormat: "<?php echo date_format_js(isset($theme_options['date_format']) ? $theme_options['date_format'] : ''); ?>",
firstDay: "<?php echo (isset($theme_options['date_format_first_day']) ? (int) $theme_options['date_format_first_day'] : 0); ?>",
dayNamesMin: ["<?php echo CarRental::t('Su') ?>", "<?php echo CarRental::t('Mo') ?>", "<?php echo CarRental::t('Tu') ?>", "<?php echo CarRental::t('Wu') ?>", "<?php echo CarRental::t('Th') ?>", "<?php echo CarRental::t('Fr') ?>", "<?php echo CarRental::t('Sa') ?>"],
monthNames: ["<?php echo CarRental::t('January') ?>", "<?php echo CarRental::t('February') ?>", "<?php echo CarRental::t('March') ?>", "<?php echo CarRental::t('April') ?>", "<?php echo CarRental::t('May') ?>", "<?php echo CarRental::t('June') ?>", "<?php echo CarRental::t('July') ?>", "<?php echo CarRental::t('August') ?>", "<?php echo CarRental::t('September') ?>", "<?php echo CarRental::t('October') ?>", "<?php echo CarRental::t('November') ?>", "<?php echo CarRental::t('December') ?>"],
dayNames: ["<?php echo CarRental::t('Sunday') ?>", "<?php echo CarRental::t('Monday') ?>", "<?php echo CarRental::t('Tuesday') ?>", "<?php echo CarRental::t('Wednesday') ?>", "<?php echo CarRental::t('Thursday') ?>", "<?php echo CarRental::t('Friday') ?>", "<?php echo CarRental::t('Saturday') ?>"],
nextText: "<?php echo CarRental::t('Next') ?>",
prevText: "<?php echo CarRental::t('Prev') ?>",
minDate: 0,
onSelect: function() {
carrental_update_business_hours(element_id);
}
});
jQuery('#carrental_to_date' + element_id).datepicker({
//showOn: "both",
beforeShow: carrental_customRange,
dateFormat: "<?php echo date_format_js(isset($theme_options['date_format']) ? $theme_options['date_format'] : ''); ?>",
firstDay: "<?php echo (isset($theme_options['date_format_first_day']) ? (int) $theme_options['date_format_first_day'] : 0); ?>",
dayNamesMin: ["<?php echo CarRental::t('Su') ?>", "<?php echo CarRental::t('Mo') ?>", "<?php echo CarRental::t('Tu') ?>", "<?php echo CarRental::t('Wu') ?>", "<?php echo CarRental::t('Th') ?>", "<?php echo CarRental::t('Fr') ?>", "<?php echo CarRental::t('Sa') ?>"],
monthNames: ["<?php echo CarRental::t('January') ?>", "<?php echo CarRental::t('February') ?>", "<?php echo CarRental::t('March') ?>", "<?php echo CarRental::t('April') ?>", "<?php echo CarRental::t('May') ?>", "<?php echo CarRental::t('June') ?>", "<?php echo CarRental::t('July') ?>", "<?php echo CarRental::t('August') ?>", "<?php echo CarRental::t('September') ?>", "<?php echo CarRental::t('October') ?>", "<?php echo CarRental::t('November') ?>", "<?php echo CarRental::t('December') ?>"],
dayNames: ["<?php echo CarRental::t('Sunday') ?>", "<?php echo CarRental::t('Monday') ?>", "<?php echo CarRental::t('Tuesday') ?>", "<?php echo CarRental::t('Wednesday') ?>", "<?php echo CarRental::t('Thursday') ?>", "<?php echo CarRental::t('Friday') ?>", "<?php echo CarRental::t('Saturday') ?>"],
nextText: "<?php echo CarRental::t('Next') ?>",
prevText: "<?php echo CarRental::t('Prev') ?>",
minDate: 0,
onSelect: function() {
carrental_update_business_hours(element_id);
}
});