JQuery Restrict the difference between two datepickers

后端 未结 4 1679
小鲜肉
小鲜肉 2021-01-24 09:04

I have 2 datepickers

  $(function() {
    $(\'#DateFrom\').datepicker({ onSelect: showUser, minDate: -90, maxDate: \"+1D\" });
  });

  $(function() {
    $(\'#         


        
4条回答
  •  走了就别回头了
    2021-01-24 09:13

    Alternate suggestion:

    If you are restricting the day they can pick in the "TO" datepicker to only 1 day, then why have a second datepicker at all? Just calculate 7 days from the FROM datepicker date and display it as text. Silly to make the user pick a date when theres only one option.

提交回复
热议问题