Yeah but then I'd have to do that for every site across multiple templates which is just tedious and unclean, especially for something that is a standard and common feature for membership software and should be incorporated. Plus I think it'd be a great feature for this extension!
And it's not like it requires changing a lot of code.
But I'll leave some quick instruction here for you if you'd like to make a quick easy update or for anyone who wants to be able to show the age of a user or age of anything.
1) Locate administrator\components\com_osmembership\libraries\mpf\form\field and copy date.php to age.php
2) In age.php on line 20 change protected $type = 'Date'; to protected $type = 'Age';
It is probably best to make an override for the component views where you want to display the age rather than editing these files directly: Here I am just using the member list and member details.
os_membership/member
os_membership/members
In default.php
Find and copy the following conditional statement and its contents directly below so that it executes next
elseif ($field->fieldtype == 'Date' && $fieldValue)
rename 'Date' to 'Age'
In this new conditional replace the following:
$fieldValue = HTMLHelper::_('date', $fieldValue, $this->config->date_format, null);
to
$fieldValue = date_diff(date_create($fieldValue), date_create('now'))->y;
I am using date_diff here to show a simple age but you may need to use another method of calculation age depending on your server and php version or how you would like to output, i.e. years months days.
However, that should do the trick!
I do think it would be great if you incorporated something like this as well as a field in the field manager to output our own format when using a date field.
Anywho, I hope this help!