Project

General

Profile

feature request #6561

TimePeriodParser support for ISO 8601 date formats

Added by Andreas Kohlbecker over 2 years ago. Updated about 1 year ago.

Status:
New
Priority:
New
Category:
cdm
Target version:
Start date:
04/10/2017
Due date:
% Done:

0%

Severity:
normal

Description

The should support ISO 8601 date formats:

  • YYYY
  • YYYY-MM
  • YYYY-MM-DD

Related issues

Related to PhycoBank - feature request #6169: Algae Registry web-application Closed 06/12/2017
Related to Edit - feature request #6564: full support for ISO 8601 date time format New 04/11/2017

History

#1 Updated by Andreas Kohlbecker over 2 years ago

#2 Updated by Andreas Kohlbecker over 2 years ago

#3 Updated by Andreas Kohlbecker over 2 years ago

  • Tags changed from phycobank to phycobank, iso8601

#4 Updated by Andreas Kohlbecker about 2 years ago

  • Category set to cdm

#5 Updated by Andreas Kohlbecker over 1 year ago

  • Assignee set to Andreas Müller

#6 Updated by Andreas Müller over 1 year ago

The TimePeriodParser already supports YYYY and YYYY-MM-DD.

However, YYYY-MM is not correctly recognized and there is a reason for it. In literature and most data to parse XXXXX-XX is used as a real period e.g. 1801-03 more often means 1801-1803 then March 1801. So the parser may become ambiguous here.
It is difficult to solve this ambiguity.

Some solutions:

  • If the 3rd and 4th digit of the year are larger then 12 or not smaller then the second part it is expected that the ISO 8601 date is meant. Otherwise use the period interpretation. This is helpful if one does not know which format might be meant, e.g. in the TaxEditor time period parser.
  • Offer explicit method to parse certain formats, such as parseIso8601() or parseStartEndPeriod() or parseSingleDate() if one knows that a time period is a single date only and not a real period.
  • Use separate parser classes for certain formats
  • Allow to pass the expected format as a parameter
  • Allow ordering priority of certain formats by the user
  • TBC

Refer also to #6564#note-2 for further discussion of ambiguity.

#7 Updated by Andreas Müller about 1 year ago

  • Tags changed from phycobank, iso8601 to phycobank, iso8601, parser

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)