Difference between revisions of "Template:Counter"
Jump to navigation
Jump to search
Little Owl (talk | contribs) |
Little Owl (talk | contribs) |
||
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}}}}}}}{{#if:{{{big|}}}|| 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:{{{big|}}}|| days}}</includeonly><noinclude>{{clear}} | ||
This template automates the streak | This template automates the big counter and the previous streak: if the current streak breaks the record, this template will handle this for you. | ||
For use in both [[Template:Begging Counter|Begging]] and [[Template:Coping Counter|Coping]] counters. | For use in both [[Template:Begging Counter|Begging]] and [[Template:Coping Counter|Coping]] counters. | ||
Line 10: | Line 10: | ||
! Input | ! Input | ||
! Output | ! Output | ||
|- | |||
| Chris last did something on {{#time:j F Y|now - 2 months}} (for the big counter). | |||
| <code><nowiki>{{Counter|</nowiki>{{#time:Y-m-d H:00:00|now - 2 months}}<nowiki>|big=yes}}</nowiki></code> | |||
| {{Counter|{{#time:Y-m-d H:00:00|now - 2 months}}|big=yes}} | |||
|- | |- | ||
| Chris last did something on {{#time:j F Y|now - 2 months}}. | | Chris last did something on {{#time:j F Y|now - 2 months}}. |
Revision as of 01:59, 25 July 2021
This template automates the big counter and the previous streak: 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 22 September 2024 (for the big counter). | {{Counter|2024-09-22 07:00:00|big=yes}}
|
61 |
Chris last did something on 22 September 2024. | {{Counter|2024-09-22 07:00:00}}
|
61 days |
Chris last did something on 22 October 2024, and the previous streak was 15 days ago. | {{Counter|2024-10-22 07:00:00|15}}
|
31 days |
Chris last did something on 22 November 2024, and the previous streak was 15 days ago. | {{Counter|2024-11-22 07:00:00|15}}
|
16 days |