I am managing a RESTful JSON data API, which is growing in scope. Currently, we are returning all dates over the wire as strings "YYYY-MM-DD", but we also need to represent the concept of partial dates.
What I mean by a partial date is a date value that has unknown components, either a Year-Month, or just a Year. In our presentation layer, this would be translated like:
2009-09-03 => '3rd September 2009'
2009-09 => 'September 2009'
2009 => 'Undated 2009'
Is there any precedent or standard for this type of data? For example, MySQL enables this by allowing 00 values in date and datetime fields - eg: '2009-00-00' will save directly to a MySQL date field, but this value does not translate consistently when parsed by most programming languages' date libraries.
What is the best way to semantically represent this concept of partial dates in the JSON feed?
Ideally, we would be able to implement a solution that was easy for our consumers to parse, but also straightforward to explain in documentation.