Page MenuHomePhabricator

{{#time:M|february}} returns mar
Closed, InvalidPublic

Description

{{#time:M|February}} returns Mar, but not Feb as would be expected. The same thing goes with the Lua eqvaluent mw.getContentLanguage():formatDate( "M", "February" ) .


Version: unspecified
Severity: normal
URL: https://test.wikipedia.org/wiki/Bug_50477

Details

Reference
bz50477

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 1:54 AM
bzimport added a project: ParserFunctions.
bzimport set Reference to bz50477.
bzimport added a subscriber: Unknown Object (MLST).

Change 71301 had a related patch set uploaded by Reedy:
Add parsertest for {{#time:M|february}} returns mar

https://gerrit.wikimedia.org/r/71301

It's June 30 today, so February means February 30, which is actually March 2, so it's Mar.

You may want {{#time:M|February 1}} instead.

{{#time:r|feb}} --> Sat, 02 Mar 2013 00:00:00 +0000
{{#time:r|mar}} --> Sat, 30 Mar 2013 00:00:00 +0000

Slightly strange, but not a bug

Change 71301 abandoned by Reedy:
Add parsertest for {{#time:M|february}} returns mar

https://gerrit.wikimedia.org/r/71301

  • Bug 59137 has been marked as a duplicate of this bug. ***

(In reply to Liangent from comment #3)

You may want {{#time:M|February 1}} instead.

Unfortunately the {{dts}} template needs to fetch the month from an arbitrary date string that may or may not have a day number.

https://en.wikipedia.org/w/index.php?title=Wikipedia:Village_pump_%28technical%29&diff=606439303&oldid=606432378

jokes_free4me wrote:

(In reply to Sam Reed (reedy) from comment #5)

Slightly strange, but not a bug

WTH do you mean "not a bug"?!? The code should NEVER use current day instead of "1st". Or current month instead of January for that matter, since IIRC there were some weeks in the 1700s that were skipped altogether, so they should be avoided too.

Please reopen and reconsider.

If so, please upstream this as a php bug. IIRC a php function is used directly to parse date string.

Adding an arbitrary year has solved the problem in enwiki's {{dts}} template. The code goes something like {{#time:m|1-{{{month}}}-2000}}.