Difference between revisions of "Template:Counter"

From CWCki
Jump to navigation Jump to search
(Created page with "<includeonly>{{formatnum:{{#ifexpr:{{#expr:({{#time:U|now}}-{{#time:U|{{{1}}}}})/86400 round 0}} > {{{2|0}}}|{{#expr:({{#time:U|now}}-{{#time:U|{{{1}}}}})/86400 round 0}}|{{{2...")
 
Line 1: Line 1:
<includeonly>{{formatnum:{{#ifexpr:{{#expr:({{#time:U|now}}-{{#time:U|{{{1}}}}})/86400 round 0}} > {{{2|0}}}|{{#expr:({{#time:U|now}}-{{#time:U|{{{1}}}}})/86400 round 0}}|{{{2}}}}}}} days</includeonly><noinclude>{{clear}}
<includeonly>{{formatnum:{{#ifexpr:{{#expr:({{#time:U|now}}-{{#time:U|{{{1}}}}})/86400 round 0}} > {{{2|0}}}|{{#expr:({{#time:U|now}}-{{#time:U|{{{1}}}}})/86400 round 0}}|{{{2}}}}}}}{{#if:{{{2}}}|&nbsp;days}}</includeonly><noinclude>{{clear}}
This template automates the streak count: if the current streak breaks the record, this template will handle this for you.
This template automates the streak count: if the current streak breaks the record, this template will handle this for you.



Revision as of 01:53, 25 July 2021

This template automates the streak count: if the current streak breaks the record, this template will handle this for you.

For use in both Begging and Coping counters.

Examples

Scenario Input Output
Chris last did something on 16 December 2024. {{Counter|2024-12-16 12:00:00}} 62 days
Chris last did something on 16 January 2025, and the previous streak was 15 days ago. {{Counter|2025-01-16 12:00:00|15}} 31 days
Chris last did something on 16 February 2025, and the previous streak was 15 days ago. {{Counter|2025-02-16 12:00:00|15}} 16 days