Template:Year category name/doc

A helper template which returns the bare name of the category on a given calendar year.

This is needed because the articles on years take three different formats ("YYY" indicates a number, e.g. "6", "29", "754", "938") This template allows accurate links to be generated.
 * All BC years: YYY BC
 * AD years 1 to 10: AD YYY
 * AD years after 10: YYY

Usage
The parameter may be:
 * A bare number for AD years, e.g.  or
 * A negative number for BC years, e.g.  or
 * A number preceded or followed by "AD", with or without a space, e.g.  or
 * A number preceded or followed by "BC", with or without a space, e.g.  or

Any other input will be ignored. There are no error messages.