Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

// request.cf · coarse context

A page that knows where it met you.

Only coarse request metadata is shown. This demo does not display or persist visitor IP addresses.

Country
US
Cloudflare location
CMH
Connection
HTTP/2
Language
Not provided

Ray ID: a22e68d9db1136cd

Jump to content

Module talk:Auto date formatter

Page contents not supported in other languages.
Add topic
From Wikipedia, the free encyclopedia
(Redirected from Module talk:Auto date formatter/doc)
Latest comment: 8 months ago by Rjjiii in topic Year only dates

Year only dates

[edit]

Trappist the monk, I didn't catch this at first, but the old version of the module was creating fictitious dates when given only a month or only a year. Compare Kraven the Hunter to this archived version where many dates begin with "(September 5," because they only had a year in the parameter. Giving only the month would cause a similar error where the module would add "1" into the date as if it were the first of the month. To quickly fix the bug, I've just stopped it from formatting incomplete dates. If you have a better solution, I am not opposed to another method. And thanks again for creating this in the first place, Rjjiii (talk) 02:45, 24 October 2025 (UTC)Reply

Good catch. The Scribunto formatDate() function is essentially the same as the {{#time}} parser function so:
{{#time:F j, Y|2025}}July 21, 2025 – today's date
{{#time:F j, Y|September}}September 21, 2026 – also today's date
I guess my only comment is that YYYY-MM dates are disallowed by MOS:DATESNO so those should raise an error when MM is 01–12. Any other value might be YYYY–YY (with an endash) which use is limited by MOS:YEARRANGE so abbreviated year ranges might also warrant an error message. The {{#time}} parser and, presumably formatDate(), rejects both of those abbreviated formats so perhaps line 39 is not required. I haven't tested that.
Trappist the monk (talk) 13:34, 24 October 2025 (UTC)Reply
I appreciate the feedback. That sounds right, but I will likely need to make an error-tracking category first to see how common the issue might be, Rjjiii (talk) 04:43, 2 November 2025 (UTC)Reply