Are there any plans for storing partial date values, for example when a month or day are unknown, or optional?

Comments

minorscience created an issue. See original summary.

mpdonadio’s picture

Version: 8.1.x-dev » 8.2.x-dev

This may be covered by #2699895: Add settings to define #date_increment for datetime and datetime_range 'default' widgets, or potentially a duplicated

The problem is that a year-only or a year+month isn't really a date, as far as the internals are concerned. We can get around this by using Jan 1 or the first of the month to fake out the system. In my experience, though, the problem is that you still need to end up interpreting the data as year-only or a year+month, and run into problems.

That said, I have run into enough problems with this, that is something worthwhile to consider (though someone should feel free to work on a contrib solution with the idea that we could consider it for inclusion in core at some point).

jasloe’s picture

Thanks for the clarification. From my own experience I can think of innumerable use cases that might benefit from partial date storage or where the currently implemented internals are too restrictive. Looks like a D7 contrib has fallen on the skids and I'll see about picking it back up or otherwise starting a new project.

https://www.drupal.org/project/partial_date

Looking at the following for inspiration and precedence.

https://github.com/bigfishtv/partial-date
https://github.com/58bits/partial-date

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

jhedstrom’s picture

Status: Active » Closed (duplicate)

Marking as duplicate of #2699895: Add settings to define #date_increment for datetime and datetime_range 'default' widgets, since that will allow partial dates to be collected.