A helper module to find the most specific chronology portal which actually exists for a given year or decade. Used to simplify linking to a chronology portal.
So all checking for century and year portals has been disabled.
If any of the decade portals are deleted, then this module should be edited to remove that decade from the table existingDecadePortals
Takes one parameter, which must be either a year (e.g. "1879", "1123") or a decade (e.g. "1940s", "730s").
If the parameter is missing, empty, or does not fit the required format, an empty string is returned.
If a portal is found, returns its name without the namespace prefix, e.g.
<nowiki>1980s</nowiki>
<nowiki>19th century</nowiki>
If no portal is found, it returns an empty string.
<nowiki>{{#invoke: FindYDCportal | findydcportal |YYYY}}</nowiki>
... where <nowiki>YYYY</nowiki>
is a 3- or 4-digit year<nowiki>{{#invoke: FindYDCportal | findydcportal |YYY0s}}</nowiki>
... where <nowiki>YYY0s</nowiki>
is a 3- or 4-digit decade<nowiki>{{#invoke: FindYDCportal | findydcportal |2018}}</nowiki>
→<nowiki>{{#invoke: FindYDCportal | findydcportal |1935}}</nowiki>
→<nowiki>{{#invoke: FindYDCportal | findydcportal |1857}}</nowiki>
→<nowiki>{{#invoke: FindYDCportal | findydcportal |736}}</nowiki>
→<nowiki>{{#invoke: FindYDCportal | findydcportal |1800}}</nowiki>
→<nowiki>{{#invoke: FindYDCportal | findydcportal |2000s}}</nowiki>
→<nowiki>{{#invoke: FindYDCportal | findydcportal |1940s}}</nowiki>
→<nowiki>{{#invoke: FindYDCportal | findydcportal |560s}}</nowiki>
→<nowiki>{{#invoke: FindYDCportal | findydcportal}}</nowiki>
→<nowiki>{{#invoke: FindYDCportal | findydcportal | }}</nowiki>
→<nowiki>{{#invoke: FindYDCportal | findydcportal | 1927-related}}</nowiki>
→<nowiki>{{#invoke: FindYDCportal | findydcportal | Swedish chef}}</nowiki>
→If the parameter is a year:
If the parameter is a decade: