Hi,
I have the following date and I am trying to calculate the age of the person but I am always getting ZERO.
Ca you help please...
- <script type='text/javascript'>
- $(function() {
- var toDate = $("#dateBirthday").datepicker({
- defaultDate: "+1w",
- dateFormat: 'dd-M-yy',
- changeMonth: true,
- numberOfMonths: 1,
- onSelect: function(selectedDate)
- {
- var start = new Date();
- var end = $('#dateBirthday').datepicker('getDate');
- var days = (end - start)/1000/60/60/24;
- if (days < 0) $("#lblAge").text(0); else $("#lblTotal").text(days+1);
- }
- });
- });
- </script>