Created
August 17, 2015 18:10
-
-
Save guyhughes/1024f22ca1a3fb7b292a to your computer and use it in GitHub Desktop.
Bootstrap DateTimePicker pairs for duration
This file contains 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
// http://eonasdan.github.io/bootstrap-datetimepicker | |
// setup a pair of datepickers | |
// Author: Guy Hughes | |
// Date: 2015-07-11 | |
function addDatePickerPair(dpStart,dpEnd) { | |
// dpStart, dpEnd = /\#[A-z0-9]+/ | |
// parameters are an ID for a single element | |
$(dpStart).on("dp.change", function (e) { | |
$(dpEnd).data("DateTimePicker").minDate(e.date); | |
}); | |
$(dpEnd).on("dp.change", function (e) { | |
$(dpStart).data("DateTimePicker").maxDate(e.date); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment