PureDateHandlingRequirements

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

  1. A 'puredate' field should be human-readable using the 'out-of-the-box' pattern skin view template.
  2. A 'puredate' field should be editable via a JSCalendarContrib UI, using the 'out-of-the-box' pattern skin edit template.
  3. 'puredate' fields should be easy to use from AJAX - provide javascript conversion functions to/from epochseconds and yyyy-mm-dd formats.

Queries

  1. 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.
  2. If two 'puredate' fields are created by two users in different time zones, then the two fields should be equal.
  3. Two 'puredate' fields should be comparable with >, >=, <, <= in queries.
  4. 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).
  5. It should be possible to convert epochseconds to a 'puredate', in queries (e.g. needed for info.date)
  6. It should be possible to use timespan operators, in queries. "Show me topics that satisfy daydiff(fieldA, fieldB) >= 7 days".

Compatibility with Datetime fields

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

  1. Subtraction of two puredate fields in queries should yield the timespan between them in a usable format, such as seconds or days.

Plugins

  1. puredate fields should be able to be rendered for edit or display using RENDERFOREDIT / RENDERFORDISPLAY, in any specified date format.
  2. ActionTrackerPlugin should be compatible with the new puredate format, when entering a due date.
Topic revision: r1 - 13 Mar 2012, KipLubliner
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy