Skip to content

Wrong returned value from createFromFormat #33

@stekycz

Description

@stekycz

PHP documentation says the method should return FALSE on failure. However Nette\Utils\DateTime returns always DateTime instance.

The problem is on the line 109. I do not think there should be call of static::from. If FALSE is passed as the argument then current datetime instance is returned.

Reproduction code

Assert::false(Nette\Utils\DateTime::createFromFormat('Y-m-d', '2014-10'));

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