Page MenuHomePhabricator

Date fields should not require a precise date
Open, Needs TriagePublicBUG REPORT

Description

If I understand correctly a date field is always requiring one precise day.

However, ISO does permit any precision:

2019-06-22
2019-06-22 13:21
2019-06
2019

Quite often the exact date is not known, and should be left to a certain month or just year.

  • A person born in March 1678. Perhaps we know baptized on 26th of March 1678 which has been recorded in books of the church. 1678-03 is valid input, but any precise day is not judged.
  • A book printed in 1987. Meaningless which precise day, even which month. A second edition is from 1999, 1987 is sufficient to distinguish but 1987-01-01 is false if printed in summer, sold in autumn 1987.
  • A monthly journal in the September issue. That is 2012-09 but no precise date is correct.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

YYYY-MM is generally insufficient to distinguish from a year range. I think there has been discussion about that particular amount of information on Phab, but it's a regular discussion topic on en.WP.

I'm not sure there is an issue with confusing YYYY-MM with a date range, because this seems likely to be only about using this in a place where we expect a single date.

The OOUI DateInputWidget, which TemplateWizard uses, does have a precision configuration parameter, so it'd be easy to pass this through if TemplateData could provide it. The widget only supports day and month; would that be enough? The time component in the example above is a different thing altogether, and should be handled with a (currently non-existing) datetime TemplateData type (I think).

If a date-precision parameter could be added to TemplateData, then perhaps a date-format one could be as well, and then TemplateWizard would be able to support whatever date formats people want (as requested in T209205).

A non-brilliant workaround at the moment is, I think, to change the templateData to use a string type.

I think it should be left to the user.

That will say the widget (borrowed from OOui, I presume) should permit to stop selection at certain level.

Take the birthday as a general example. For the recent two centuries usually date of birth is known exactly. However, if you go four or six centuries back, often only month and year or just the year is known. Mothers generated twelve or twenty children. Those which survived the first four weeks have been baptized. Date of baptism has been the first recorded entry. Nobody knew which exactly has been the day of birth, parents could neither read nor write nor got a calendar.

The template is equipped to expect a single date for birth, but if not known precisely in some cases we will not introduce a second field with date of birth if only year and month is known, a third field with date of birth if only year is known, and one further template field for date of death if only year and month is known, and one more field for date of death if only year is known.

There are several tools to fill a template around. Some care about 8 digit dates. Others don't. I'm bound to one which does. German Literatur template requires a date of publishing which in general is 4 digit year only. So I fill it with 01-01 only to delete that afterwards. That's awkward.

Aklapper changed the subtype of this task from "Task" to "Feature Request".Dec 4 2021, 5:01 PM
Sinuhe20 changed the subtype of this task from "Feature Request" to "Bug Report".Apr 11 2023, 3:46 PM
Sinuhe20 subscribed.

I see this as a bug if the wizard is more restrictive than the actual date type.