Flexible date formats
Closed, ResolvedPublic

Description

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

Sophivorus updated the task description. (Show Details)
Sophivorus triaged this task as Low priority.
Sophivorus updated the task description. (Show Details)May 28 2017, 11:23 PM
Sophivorus added a subscriber: Phil_Boswell.
Sophivorus updated the task description. (Show Details)May 28 2017, 11:25 PM
Zache added a subscriber: Zache.Jul 28 2017, 9:14 AM

Citoid and VE will use ISO dates

https://www.mediawiki.org/wiki/Citoid/Enabling_Citoid_on_your_wiki#Access_date_is_formatted_differently_on_my_wiki

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.

Sophivorus added a comment.EditedJul 28 2017, 1:03 PM

@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.

Zache added a comment.Jul 28 2017, 1:20 PM

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

Sophivorus closed this task as Resolved.Jul 28 2017, 1:33 PM
Sophivorus claimed this task.