Support #381

Updated by L. Lertsutham almost 8 years ago

<p>via David Fichtmüller from ABCD Wiki ( http://abcd.biowikifarm.net/wiki/Internal:ABCD_Corrections#Change_DateTimeISO_to_exclude_impossible_dates )</p>

<p>(Improvement    <span title="Backward Compatible?">not backward compatible</span>    <span title="Status of the Bug">Status: Suggested</span>)</p>

<p>With the current definition of the DateTimeISO type it is valid to have impossible dates like 2012-04-31. The Regular Expression (RegEx) used to define the DateTimeISO type could be modified to exclude these types. Only checking for leap years is not possible with RegEx, so the 29th of February will be a valid day even for non-leap-years.</p>

<p>If all of the changes suggested above for the type DateTimeISO are accepted, the new RegEx would be</p>

<p>\d\d\d\d(\-((0[1-9]|1[012])|((0[13578]|1[02])\-((0[1-9])|1\d|2\d|3[01])|(0[469]|11)\-((0[1-9])|1\d|2\d|30)|(02)\-((0[1-9])|1\d|2\d))(T(0\d|1\d|2[0-3])(:[0-5]\d){0,2}(.\d+)?(Z|[+\-](0\d|1[12])(:[0-5]\d)?)?)?))?</p>

<p>If you would like to test this RegEx, go to http://gskinner.com/RegExr/, type in ^()$ and paste the RegEx in between these parentheses. Check the box "multiline" if you want to test more than one date. Here are a few examples that will work:</p>

<p> </p>

<p>2012</p>

<p>2012-11</p>

<p>2013-10-15</p>

<p>2008-03-31T16</p>

<p>2008-03-31T16:31</p>

<p>2008-03-31T16:31:15</p>

<p>2008-01-31T16:31:15.13</p>

<p>2008-01-31T16:31:15.13+02:00</p>

<p>2008-01-31T16:31+02:00</p>

<p>2008-01-31T16+02:00</p>

<p>2008-01-31</p>

<p>2008-02-29</p>

<p>2008-03-31</p>

<p>2008-04-30</p>

<p>2008-05-31</p>

<p>2008-06-30</p>

<p>2008-07-31</p>

<p>2008-08-31</p>

<p>2008-09-30</p>

<p>2008-10-31</p>

<p>2008-11-30</p>

<p>2008-12-31</p>

<p> </p>

<p>and here are some examples that will not work anymore:</p>

<p> </p>

<p>2008-02-31</p>

<p>2008-02-30</p>

<p>2008-04-31</p>

<p>2008-06-31</p>

<p>2008-09-31</p>

<p>2008-11-31</p>

<p>--11</p>

<p>--11-15</p>

<p>---15</p>

<p> </p>

<p>This will make dates less ambiguous and more error proof.</p>

<p>Effected Elements:</p>

<p><a href="http://terms.tdwg.org/wiki/abcd2:Identification-ISODateTimeBegin">/DataSets/DataSet/Units/Unit/Identifications/Identification/Date/ISODateTimeBegin</a></p> &lt;p&gt;/DataSets/DataSet/Units/Unit/Identifications/Identification/Date/ISODateTimeBegin&lt;/p&gt;

<p><a href="http://terms.tdwg.org/wiki/abcd2:Identification-ISODateTimeEnd">/DataSets/DataSet/Units/Unit/Identifications/Identification/Date/ISODateTimeEnd</a></p> &lt;p&gt;/DataSets/DataSet/Units/Unit/Identifications/Identification/Date/ISODateTimeEnd&lt;/p&gt;

<p><a href="http://terms.tdwg.org/wiki/abcd2:PreviousUnit-ISODateTimeBegin">/DataSets/DataSet/Units/Unit/SpecimenUnit/History/PreviousUnits/PreviousUnit/Date/ISODateTimeBegin</a></p> &lt;p&gt;/DataSets/DataSet/Units/Unit/SpecimenUnit/History/PreviousUnits/PreviousUnit/Date/ISODateTimeBegin&lt;/p&gt;

<p><a href="http://terms.tdwg.org/wiki/abcd2:PreviousUnit-ISODateTimeEnd">/DataSets/DataSet/Units/Unit/SpecimenUnit/History/PreviousUnits/PreviousUnit/Date/ISODateTimeEnd</a></p> &lt;p&gt;/DataSets/DataSet/Units/Unit/SpecimenUnit/History/PreviousUnits/PreviousUnit/Date/ISODateTimeEnd&lt;/p&gt;

<p><a href="http://terms.tdwg.org/wiki/abcd2:Gathering-DateTime-ISODateTimeBegin">/DataSets/DataSet/Units/Unit/Gathering/DateTime/ISODateTimeBegin</a></p> &lt;p&gt;/DataSets/DataSet/Units/Unit/Gathering/DateTime/ISODateTimeBegin&lt;/p&gt;

<p><a href="http://terms.tdwg.org/wiki/abcd2:Gathering-DateTime-ISODateTimeEnd">/DataSets/DataSet/Units/Unit/Gathering/DateTime/ISODateTimeEnd</a></p> &lt;p&gt;/DataSets/DataSet/Units/Unit/Gathering/DateTime/ISODateTimeEnd&lt;/p&gt;

Back