Template:Ayd/doc

This template returns the number of full years and surplus days between two specified dates. If only one date is entered, the template returns the number of full years and surplus days between the specified date and today's date.

A hidden sort key is included so values produced by this template will work properly in sortable tables. The sort key is calculated from the number of days between the given dates, and is compatible with number table sorting.

This is temporary documentation resulting from Template talk:Age in years and days which shows problems when age in years and days outputs a hidden sort key. It is proposed that will not output a hidden sort key, so  is needed for when a sort key is wanted.

Usage
For convenience, the redirect &#123;&#123;ayd&#125;&#125; can be used. Each date can be entered in a single parameter, or each date can be entered as three parameters (year, month, day).



An error is shown if an entered date is not valid (1900 was not a leap year).
 * → Error: Second date should be year, month, day