Page MenuHomePhabricator

Wrong interpretation of dates when a function is called from wikitext with a blank parameter
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Go on Dagbani Wikipedia, in a day of month less or equal than 12
  • In visual mode edit, insert the function call {{#function:Z20780||Z1002}}: it should display the current day in English

What happens?:
If today the date is dd-mm-yyyy, the blank parameter is instead interpreted as mm-dd-yyyy.

For example, the following screenshot was taken the day 6 September 2025:

Screenshot 2025-09-06 140824.png (871×616 px, 37 KB)

This could be linked with the fact that Dagbani uses the mm-dd-yyyy format, so the reader function Z23990 interprets the input in mm-dd-yyyy format if ambiguous.

What should have happened instead?:
The blank parameter should have been interpreted as the correct current date.

Event Timeline

The ISO 8601 formats (like yyyy-mm-dd or yyyymmdd) are instead guaranteed to be interpreted as such in all the languages by the reader function Z20808.

Jdforrester-WMF subscribed.

This provisionally sounds like the reading function for dates should support Dagbani formats, rather than a software bug. To investigate.

The Dagbani reading function (Z23990) already support the mdy Dagbani format (for example, the input "06-09-2025" is correctly interpreted as 9 June 2025)

ecarg changed the task status from Open to In Progress.Thu, Oct 22, 5:11 AM
ecarg claimed this task.

Change #1357914 had a related patch set uploaded (by Ecarg; author: Ecarg):

[mediawiki/extensions/WikiLambda@master] parserfunction: use ISO 8601 for dfault date arg

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

Change #1357914 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] parserfunction: use ISO 8601 for dfault date arg

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