Page MenuHomePhabricator

Flexible date formats
Closed, ResolvedPublic


When a parameter is marked as of type "date" in the template data of a cite template, ProveIt displays a Today button next to it, that when clicked, inserts today's date in the format yyyy-mm-dd. This is the preferred format according to the template data documentation and the English Wikipedia documentation, but in some occasions and in some wikis it may not be the preferred format.

The date format should be configurable at the wiki-level when initializing the gadget at MediaWiki:Gadget-ProveIt.js.

The date format should also be configurable at the template-level through the maps object. For example, the maps object could look like so:

"date-format": "dmy"

This would tell ProveIt to format the dates in that template according to a day-month-year pattern.

Finally, the date format should be configurable at the reference-level by using the maps object to tell ProveIt which parameter defines the date format. For example, in the English Wikipedia, such parameter is called "df" in the Cite book template, so the maps object should look like so:

"date-format-parameter": "df"

This would tell ProveIt to format the dates according to the value passed on to the "df" parameter.

Related Objects

Event Timeline

Sophivorus created this task.
Sophivorus updated the task description. (Show Details)

Citoid and VE will use ISO dates

The dates are in ISO format, which is an international standard. On the back-end, we're sticking to ISO and in the future all dates will all be in ISO, not just access date. This is because it is an unambiguous way to present the date in any language. If the community doesn't like the way this looks to the user, it is possible to edit the citation template to format the ISO dates to something that is standard in your language. For instance, you can add logic to the template such that if the date is detected to be in ISO yyyy/mm/dd format, the date is reformatted *to appear* to be dd/mm/yyyy on the page. However, if you do this, the underlying data (i.e. when you edit the wikitext, or the form in VisualEditor) will still remain the same.

@Zache Ah, cool, then I think that pretty much solves this task! One little question though: what is the correct delimiter between date fragments? Is it yyyy-mm-dd or yyyy/mm/dd? The Wikipedia article suggests dashes, but the documentation you quoted suggests slashes.

Visual editor saves dates in yyyy-mm-dd format.

Sophivorus claimed this task.