Jump to content

Module:CalibrationCycle/doc: Difference between revisions

From The Sovereign Games (MoA Lab)
Created page with "<noinclude> {{Documentation}} </noinclude> == Description == This module calculates the status of review cycles based on a given date. It is primarily used to determine whether a page's last review is still current, approaching its deadline, or overdue. It is designed to work together with Semantic MediaWiki properties (especially <code>Has cycle status</code> and <code>Last reviewed</code>). == Available Functions == === cycleStatus === Returns the current review s..."
 
No edit summary
Line 2: Line 2:
{{Documentation}}
{{Documentation}}
</noinclude>
</noinclude>
== Description ==
== Description ==


Line 63: Line 64:
{{#invoke:CalibrationCycle|cycleStatus|2026-07-08|90}}
{{#invoke:CalibrationCycle|cycleStatus|2026-07-08|90}}
</syntaxhighlight>
</syntaxhighlight>
Returns: <code>Current</code>, <code>Due Soon</code>, or <code>Overdue</code> depending on today's date.


<syntaxhighlight lang="wikitext">
<syntaxhighlight lang="wikitext">
{{#invoke:CalibrationCycle|cycleStatus|2025-01-01}}
{{#invoke:CalibrationCycle|cycleStatus|2025-01-01}}
</syntaxhighlight>
</syntaxhighlight>
Uses the default 90-day threshold.


=== daysSince ===
=== daysSince ===
Line 98: Line 95:
==== Return Values ====
==== Return Values ====


- Returns the number of days as a string.
* Returns the number of days as a string.
- Returns an empty string if the date is invalid or missing.
* Returns an empty string if the date is invalid or missing.


==== Example ====
==== Example ====
Line 109: Line 106:
== Usage in Templates ==
== Usage in Templates ==


This module is typically called from within another template (such as <code>[[Template:Admin Page Status]]</code>) rather than directly on pages.
This module is typically called from within another template (such as <code>Template:Admin Page Status</code>) rather than directly on pages.


Example from inside a template:
Example from inside a template:


```wikitext
<pre><nowiki>
| Has cycle status = {{#invoke:CalibrationCycle|cycleStatus|{{{review_date|}}}|{{{review_threshold|90}}}}}
| Has cycle status = {{#invoke:CalibrationCycle|cycleStatus|{{{review_date|}}}|{{{review_threshold|90}}}}}
</nowiki></pre>

Revision as of 06:24, 9 July 2026

Template:Documentation


Description

This module calculates the status of review cycles based on a given date. It is primarily used to determine whether a page's last review is still current, approaching its deadline, or overdue.

It is designed to work together with Semantic MediaWiki properties (especially Has cycle status and Last reviewed).

Available Functions

cycleStatus

Returns the current review status of a page.

Usage

{{#invoke:CalibrationCycle|cycleStatus|review_date|threshold_in_days}}

Parameters

Parameter Type Required Description
review_date string Yes The date of the last review in YYYY-MM-DD format.
threshold_in_days number No Number of days before a review is considered overdue. Defaults to 90 if not provided.

Return Values

Value Meaning
Current Review is still within the acceptable window.
Due Soon Review is approaching the deadline (within the last 25% of the cycle).
Overdue Review date has passed the threshold.
Unknown No valid date was provided.

Examples

{{#invoke:CalibrationCycle|cycleStatus|2026-07-08|90}}
{{#invoke:CalibrationCycle|cycleStatus|2025-01-01}}

daysSince

Returns the number of whole days since the given date.

Usage

{{#invoke:CalibrationCycle|daysSince|review_date}}

Parameters

Parameter Type Required Description
review_date string Yes Date in YYYY-MM-DD format.

Return Values

  • Returns the number of days as a string.
  • Returns an empty string if the date is invalid or missing.

Example

{{#invoke:CalibrationCycle|daysSince|2026-07-08}}

Usage in Templates

This module is typically called from within another template (such as Template:Admin Page Status) rather than directly on pages.

Example from inside a template:

| Has cycle status = {{#invoke:CalibrationCycle|cycleStatus|{{{review_date|}}}|{{{review_threshold|90}}}}}