Skip to content

Could not parse the date '1964/2008'  #81

@Natkeeran

Description

@Natkeeran

We have an EDTF field. Inputting range date such as 1964/2008 throws the following error: Could not parse the date '1964/2008'

Seems like this is where the checking happens: https://github.com/Islandora/controlled_access_terms/blob/2.x/src/EDTFUtils.php#L193

Additional Notes

  • "islandora/controlled_access_terms": "2.x-dev",
  • "professional-wiki/edtf": "^2.0"
<?php
$date = "1964/2008";
$pattern = '/^([%\?~])?(Y?(-?[\dX]+)(E\d)?(S\d)?)([%\?~])?-?([%\?~])?([\dX]{2})?([%\?~])?-?([%\?~])?([\dX]{2})?([%\?~])?$/';
preg_match($pattern, $date, $parsed_date);
print_r($parsed_date);
?>

It does work in the sandbox!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions