Template:GrowthTime

Revision as of 16:39, 5 June 2023 by Lizz (talk | contribs)

Description

This template is used to insert an ingredient icon inline with a growth time for crops and fruits.

This template allows the time to be rendered in a friendly, human-readable way, but maintains the value so that it can be sorted in tables. It also standardizes the formatting of displaying time across the wiki, which makes it easier to maintain.

The template does not currently properly handle use cases where growthTime is greater than 1440 minutes (1 day), as there are no in-game items that exceed this growth time.

Usage

In its most basic form, this template can be used by entering the following onto a relevant page:

{{growthTime|<<number of minutes>>}}

There is also the optional parameter concise that can be added:

{{growthTime|<<number of minutes>>|concise}}

concise is intended for use in cases where the information is used in a large, information-heavy table, whereas the default setting is appropriate for an infoBox template.

Examples

{{growthTime|20}}

results in...

Ingredients.png 20 min


{{growthTime|135|concise}}

results in...

Ingredients.png 2 h 15 m


Sortable Table Example:

Name Grow Time Grow Time in Preferred Biome
Crop 1 Ingredients.png 1 hour 30 min Ingredients.png 1 hour 21 min
Crop 2 Ingredients.png 20 min Ingredients.png 18 m
Crop 3 Ingredients.png 5 h 7 m Ingredients.png 4 hours 36 min
Crop 4 Ingredients.png 1 hour Ingredients.png 54 min
Crop 5 Ingredients.png 1 d 1 m Ingredients.png 21 hours 36 min
Crop 6 Ingredients.png 48 hours 1 min Ingredients.png 43 hours 12 min