Template:Abbreviated hahr: Difference between revisions

From Guild of Archivists
(Create 'Abbreviated hahr' template.)
 
(Simplify definition and replace non-breaking space with ordinary space.)
Line 1: Line 1:
<includeonly>{{#if: {{{1|{{{ordinal|}}}}}} || {{error|Parameters 1 or ordinal must be provided with a valid argument.}}}}<!--
<includeonly>{{#if: {{{1| {{{ordinal| }}} }}} || {{error|Parameters 1 or ordinal must be provided with a valid argument.}} }}<!--
-->{{#if: {{{1|{{{ordinal|}}}}}} |
-->{{#if: {{{1| {{{ordinal| }}} }}} |
{{#ifexpr: (({{{1|{{{ordinal|0}}}}}} >= 0) and ({{{1|{{{ordinal|0}}}}}} <= 624))
{{#ifexpr: (({{{1|{{{ordinal|0}}}}}} >= 0) and ({{{1|{{{ordinal|0}}}}}} <= 624))
| {{#switch: {{{suffix|yes}}} | yes = {{#expr: 9375 + {{{1}}}}}&nbsp;DE | no = {{#expr: 9375 + {{{1}}}}} | {{error|Parameter suffix may only have a value of 'yes' or 'no'.}}}}
| {{#expr:(9375 + {{{1}}})}}{{#ifeq:{{{suffix|yes}}}|yes|" DE"}}
| {{error|Parameter suffix may only have a value of 'yes' or 'no'.}}
}}
| {{error|Provided argument must be an integer between 0 and 624 inclusive.}}
| {{error|Provided argument must be an integer between 0 and 624 inclusive.}}
}}
}}</includeonly>
}}</includeonly>
<noinclude>{{Documentation}}</noinclude>
<noinclude>{{Documentation}}</noinclude>

Revision as of 01:31, 2 December 2024

Template documentation[view] [edit] [history] [purge]

Converts the abbreviated hahr format used in journals to a complete hahr value. The full hahr value is calculated by treating the abbreviated hahr as an offset from the hahr 9375, i.e. the beginning of the most recent hahrtee fahrah.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Hahr (Abbreviated)1 ordinal

The abbreviated hahr to be extended to a full hahr.

Numberrequired
Suffixsuffix

When set to 'yes', includes " DE" as a suffix. When set to 'no', omits the " DE" suffix.

Suggested values
yes no
Auto value
no
Stringoptional