| <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