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

add date creation methods? #82

Closed
bendavies opened this issue Jan 22, 2019 · 4 comments
Closed

add date creation methods? #82

bendavies opened this issue Jan 22, 2019 · 4 comments

Comments

@bendavies
Copy link

bendavies commented Jan 22, 2019

these can return false:
http://php.net/manual/en/function.date-create-from-format.php
http://php.net/manual/en/function.date-create-immutable-from-format.php

there are probably others? WDYT?

@rieschl
Copy link

rieschl commented Feb 5, 2019

...and what about the DateTime and DateTimeImmutable classes? They "convert" invalid date strings which is even worse than false and just log it in DateTime::getLastErrors
Or is this package restricted to functions?

@moufmouf
Copy link
Member

moufmouf commented Feb 5, 2019

@bendavies You are perfectly right.
The fact is I generate the Safe functions from the PHP doc (there are too many functions to do that manually).
date_create_from_format is an alias of DateTime::createFromFormat and is not documented as the other functions. My code generator for Safe doesn't know yet how to handle the aliases (or the classes).

It is definitely on the TODO for Safe v1 though. Any help is welcome by the way :)
Also, this is directly related to #7

@Kharhamel
Copy link
Collaborator

#138

@Kharhamel
Copy link
Collaborator

we now have custom datetime classes in safe in 1.0.0-beta1. Don't hesitate to test them

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

4 participants