Custom Fields
Support Meta Box AIO Set a minimum date in a date field in dependence of another date field

  • Creator
  • #17339

    Hey there, I´m new to Meta Box and am trying to get my first results. What I want to achieve is to have two date fields like in a booking engine with a check-in and a check-out date.

    I added two date fields to a group (“from” and “to”). Then I used the dateFormat option to get the right date format for my region. Additionally I added the “save_format” attribute to save the date format for sorting operations.

    Next I tried to format the “to” date in dependence of the from date field. Therefore I used the “minDate” option from the date picker options and hoped that I could get and set the date from the “from” field as a new date in the value field. Finally what I want to achieve is that the “to” field is always after the “from” field. Earlier dates shouldn´t be selectable. Is that achievable?

    Thanks a lot in advance for your help. I really appreciate it.


  • You must be logged in to reply to this topic.