Skip to content

Instantly share code, notes, and snippets.

@mohammad-hammal mohammad-hammal/index.js
Last active Oct 29, 2018

Embed
What would you like to do?
$(function(){
$('form').on('submit', function(event) {
event.preventDefault();
var dateValue = $('.date-input').val();
if (!dateValue) {
alert('Please enter valid value');
return;
}
var age = moment().diff(dateValue, 'years');
alert(age);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.