Template:CheckYear

From Pestinfo-Wiki
Jump to: navigation, search

The template takes the following 2 parameters:

|1= 
previous error message
|2= 
year or date string

The first 4 characters of the year or date string must be a year larger than 1700 and not higher than the current year, otherwise an error message is returned. If the Error message (first parameter) already contains some text then the separator ";;" and the new message is appended. If there is no error parameter 1 is returned.

Usage

{{CheckYear|1=Previous Error Message|2=}}
{{CheckYear|2=}}

… results in:

Year or Date is missing: The content of the year/date field must begin with a valid year between 1700 and the current year. Please correct the input data.
{{CheckYear|2=1524}}

… results in:

Year “1524” does not match: The content of the year/date field must begin with a valid year between 1700 and the current year. Please correct the input data.

Technical Documentation

Returns:

  • error message or none