Last active
November 9, 2021 16:41
-
-
Save dangrossman/98d8f1c304328c191b1ad33ac21354fd to your computer and use it in GitHub Desktop.
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
<input type="text" name="birthday" value="10/24/1984" /> | |
<script> | |
$(function() { | |
$('input[name="birthday"]').daterangepicker({ | |
singleDatePicker: true, | |
showDropdowns: true, | |
minYear: 1901, | |
maxYear: parseInt(moment().format('YYYY'),10) | |
}, function(start, end, label) { | |
var years = moment().diff(start, 'years'); | |
alert("You are " + years + " years old!"); | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment