Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I restrict Two dates in ACF date picker for Starting date and Ending Date in Wordpress?

I have created an event post type in Wordpress. For that I have put starting date and ending date from ACF datepicker.

I want admin can select Ending date greater than Starting Date.

Is there any way for restricting Starting Date and Ending Date?

For example, if Admin choose 1st Jan 2016 as starting date, then he can only select the ending date 1st Jan or greater then the selected date.

like image 653
Jitendra Damor Avatar asked Apr 01 '15 12:04

Jitendra Damor


1 Answers

I think we can do it with java script and use this code to set the limit of the end date :

$( ".selector" ).datepicker({
  minDate: new Date(  )
});
like image 56
Ahmed Bltagy Avatar answered Sep 27 '22 21:09

Ahmed Bltagy