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

DateTimeFormatter: Add option to return invalid date string unfiltered #2

Closed
7 tasks done
weierophinney opened this issue Dec 31, 2019 · 2 comments
Closed
7 tasks done

Comments

@weierophinney
Copy link
Member

  • Are you fixing a bug?
    • Detail how the bug is invoked currently.
$filter = new DateTimeFormatter();
$filter->filter('2013-31-31'); // throws exception
  • Detail the original, incorrect behavior.
    DateTimeFormatter::filter throws an exception in the event that the input is not a parsable date string
  • Detail the new, expected behavior.
$filter = new DateTimeFormatter();
$filter->setThrowInvalidDateException(false);
$filter->filter('2013-31-31'); // returns "2013-31-31"
  • Base your feature on the master branch, and submit against that branch.
  • Add a regression test that demonstrates the bug, and proves the fix.
  • Add a CHANGELOG.md entry for the fix.

Originally posted by @marcguyer at zendframework/zend-filter#84

@weierophinney
Copy link
Member Author

@marcguyer This is a new feature because the exception was previously a desired result. Please use the develop branch instead.


Originally posted by @froschdesign at zendframework/zend-filter#84 (comment)

@gsteel
Copy link
Member

gsteel commented Sep 3, 2024

This issue and its old PR is pretty stale - in 3.0 the behaviour is the same as the 2.x series so if anyone wants to implement the optional behaviour change, its best to target 3.0 now.

Ref #160

@gsteel gsteel closed this as completed Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants