Skip to content

Nette\Utils\DateTime::from(NULL) causes TypeError #211

@KacerCZ

Description

@KacerCZ

Version: 3.0.3

Bug Description

Invocation of \Nette\Utils\DateTime::from(NULL) causes 'PHP Fatal error: Uncaught TypeError: DateTime::__construct() expects parameter 1 to be string, null given in ...'.

Steps To Reproduce

var_dump( \Nette\Utils\DateTime::from(NULL) )

Expected Behavior

Return current time as in version 2.4/2.5.

Possible Solution

Add special case to \Nette\Utils\DateTime::from() when parameter is NULL then call new static( 'now' ).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions