Template:Get Years Active

From Broadcast for Schools.co.uk.co.uk
Jump to: navigation, search
{{ Get Years Active | firstrunfrom=<firstrunfrom> | enddate=<enddate> }}

Calculates the number of academic years that a programme was active for, by subtracting the Property:First run from date from the Property:End date (calculated by Template:Get End Date). In a template to provide consistent error handling.

NB. Because Template:Get Academic Year falls back to the current date & time if it is not given the correct parameters, this template will return 1 if it is not given the correct parameters. It will also return 1, or unexpected values such as -1, if it is given incomplete dates such as "2010" or "2010/06". For now, ensure it is given complete dates (use Calc dates), but may need to revisit in the future.

This will return nothing if firstrunfrom is not defined, so as not to mess up programmes with no date information