Template talk:Map bonus reward overview
Date range[edit]
{{#if: <!-- hide whitespace -->
week quotient: {{#vardefineecho:week quotient|{{#expr: (({{#time: U | {{{date|now}}} {{{1|}}} }} - {{#time: U | 2015/10/08 20:00 }})/(60*60*24*7)) fmod 1 }}}}
week start: {{#vardefineecho:week start unix|{{#expr: {{#time: U | {{{date|now}}} {{{1|}}} }} - ({{#var:week quotient}}*(60*60*24*7)) }}}}
week end: {{#vardefineecho:week end unix|{{#expr: {{#time: U | {{{date|now}}} {{{1|}}} + 7 days }} - ({{#var:week quotient}}*(60*60*24*7)) }}}}
}}{{#time: h:i, d F Y | @{{#var:week start unix}}}} — {{#time: h:i, d F Y | @{{#var:week end unix}}}}
Ran out of time to finish this, but probably can combine the above with Template:UTC time. -Chieftain Alex
06:46, 24 September 2021 (UTC)
Incorrect rollover time format[edit]
The template used h instead of G to format its unix time in two #time parser functions in line 11. This caused the hour of the rollover time to be wrongly displayed in a twelve-hour format rather than the intended and correct twenty-four-hour format.
In practice, this lead to the template stating a wrong time of "08:00 UTC" for the rollover time instead of the correct "20:00 UTC". See the image as well the earlier template revision for the behavior. For some reason, Special:Redirect/revision/2338659 returns a 403, so you will have to search the revision up manually if you are interested.
My most recent edit should have fixed this issue. - Danslencre (talk) 16:55, 13 March 2025 (UTC)
- Okay good spot. I think it should have been an uppercase H, which most of the other templates use. The mediawiki docs mw:Help:Extension:ParserFunctions##time state:
- G = Hour in 24-hour format, not zero-padded.
- H = Hour in 24-hour format, zero-padded.
- h = Hour in 12-hour format, zero-padded.
- -Chieftain Alex
18:31, 13 March 2025 (UTC)
- Sounds about right. Was not aware on the standards of this wiki at all and went with personal preference. Thanks for the quick fix. ^^ - Danslencre (talk) 21:52, 13 March 2025 (UTC)