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

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

Closed
KacerCZ opened this issue Jan 7, 2020 · 1 comment
Closed

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

KacerCZ opened this issue Jan 7, 2020 · 1 comment

Comments

@KacerCZ
Copy link

KacerCZ commented Jan 7, 2020

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' ).

@dg dg closed this as completed in 9ca3386 Jan 7, 2020
dg added a commit that referenced this issue Jan 7, 2020
@KacerCZ
Copy link
Author

KacerCZ commented Jan 7, 2020

@dg Thank you.

dg added a commit that referenced this issue Jan 14, 2020
dg added a commit that referenced this issue Jan 14, 2020
dg added a commit that referenced this issue Jan 14, 2020
dg added a commit that referenced this issue Jan 18, 2020
dg added a commit that referenced this issue Jan 20, 2020
dg added a commit that referenced this issue Jan 20, 2020
dg added a commit that referenced this issue Jan 20, 2020
dg added a commit that referenced this issue Jan 20, 2020
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

1 participant