Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Natkeeran opened this issue May 16, 2022 · 1 comment
Closed

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

Natkeeran opened this issue May 16, 2022 · 1 comment

Comments

@Natkeeran
Copy link
Contributor

Natkeeran commented May 16, 2022

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!

@seth-shaw-unlv
Copy link
Contributor

Can you check your widget settings. Ensure that "Permit date intervals." is checked:
Capture

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants