Jump to content
Wikipedia The Free Encyclopedia

Module talk:Auto date formatter

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

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}} → November 15, 2025 – today's date
{{#time:F j, Y|September}} → September 15, 2025 – 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 ]

AltStyle によって変換されたページ (->オリジナル) /