Created
March 9, 2021 04:37
-
-
Save alex-authlab/83720081eb0cb914e3e05772610c33eb to your computer and use it in GitHub Desktop.
flatpicker set check in date < check out date
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// booking date check in > check out | |
$( document ).ready(function() { | |
var check_in = flatpickr(".in-date",{dateFormat: "d/m/Y",}); | |
var check_out = flatpickr(".out-date",{dateFormat: "d/m/Y",}); | |
check_in.element.addEventListener("change", function(){ | |
check_out.set( "minDate" , check_in.element.value ); | |
}); | |
check_out.element.addEventListener("change", function(){ | |
check_in.set( "maxDate" , check_out.element.value ); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment