diff --git a/web/public/js/services/user-utils.js b/web/public/js/services/user-utils.js index f545b202c..f93d81b8b 100644 --- a/web/public/js/services/user-utils.js +++ b/web/public/js/services/user-utils.js @@ -10,6 +10,10 @@ angular.module('cpZenPlatform').factory('userUtils', var approvalRequired = ['mentor', 'champion']; userUtils.getAge = function (birthDate) { + if (birthDate === null) { + return 0; + } + return moment.utc().diff(moment(birthDate), 'years'); };