SyntaxFix
Write A Post
Hire A Developer
Questions
This method is easy and powerful.
Value is a date and "DD-MM-YYYY" is the mask of the date.
moment().diff(moment(value, "DD-MM-YYYY"), 'years');