Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

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

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

marcguyer
Copy link
Contributor

  • add documentation for DateTimeFormatter. Addresses DateTimeFormatter #58.
  • add @todo notation in docblock for $format property
  • add tests for new option
  • 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.

* add documentation for DateTimeFormatter. Addresses zendframework#58.
* add @todo notation in docblock for `$format` property
* add tests for new option
@froschdesign froschdesign added this to the 2.10.0 milestone Mar 15, 2019
CHANGELOG.md Show resolved Hide resolved
src/DateTimeFormatter.php Outdated Show resolved Hide resolved
@froschdesign
Copy link
Member

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

@weierophinney
Copy link
Member

This repository has been closed and moved to laminas/laminas-filter; a new issue has been opened at laminas/laminas-filter#2.

@weierophinney
Copy link
Member

This repository has been moved to laminas/laminas-filter. If you feel that this patch is still relevant, please re-open against that repository, and reference this issue. To re-open, we suggest the following workflow:

  • Squash all commits in your branch (git rebase -i origin/{branch})
  • Make a note of all changed files (`git diff --name-only origin/{branch}...HEAD
  • Run the laminas/laminas-migration tool on the code.
  • Clone laminas/laminas-filter to another directory.
  • Copy the files from the second bullet point to the clone of laminas/laminas-filter.
  • In your clone of laminas/laminas-filter, commit the files, push to your fork, and open the new PR.
    We will be providing tooling via laminas/laminas-migration soon to help automate the process.

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

Successfully merging this pull request may close these issues.

3 participants