I have done my best to write up requirements for how Foswiki can be improved to better handle 'pure dates'.
See
ConvertDatesToISO,
CreateISODateFormat
Datatype
- Create a new DataForms field type (as the existing 'date' type allows storage of any date format).
- OR call the new type 'date', and make users responsible for converting their wiki apps to the new format (in a major release).
Reading / Writing
- A 'puredate' field should be human-readable using the 'out-of-the-box' pattern skin view template.
- A 'puredate' field should be editable via a JSCalendarContrib UI, using the 'out-of-the-box' pattern skin edit template.
- 'puredate' fields should be easy to use from AJAX - provide javascript conversion functions to/from epochseconds and yyyy-mm-dd formats.
Queries
- If two 'puredate' fields fieldA, fieldB are set to the same date (via form edit), then the two fields should be equal - that is to say, fieldA = fieldB in IF, SEARCH, QUERY, and DBQUERY macros.
- If two 'puredate' fields are created by two users in different time zones, then the two fields should be equal.
- Two 'puredate' fields should be comparable with >, >=, <, <= in queries.
- It should be possible to convert a constant like '2012-03-12' to a 'puredate', in queries. It should also be possible to convert a constant like '3/12/2012' to a 'puredate', in queries (i.e. a conversion operator that takes the format as a parameter).
- It should be possible to convert epochseconds to a 'puredate', in queries (e.g. needed for info.date)
- It should be possible to use timespan operators, in queries. "Show me topics that satisfy daydiff(fieldA, fieldB) >= 7 days".
Compatibility with Datetime fields
- It should be possible to compare puredate fields with datetime fields in queries (see CreateISODateFormat). A puredate value '2012-03-12' is less than any datetime that occurs after 2012-03-12T00:00:00Z, and is greater than any datetime that occurs before 2012-03-12T00:00:00Z.
Nice to have
- Subtraction of two puredate fields in queries should yield the timespan between them in a usable format, such as seconds or days.
Plugins
- puredate fields should be able to be rendered for edit or display using RENDERFOREDIT / RENDERFORDISPLAY, in any specified date format.
- ActionTrackerPlugin should be compatible with the new puredate format, when entering a due date.