-
-
Notifications
You must be signed in to change notification settings - Fork 30
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 parsing methods where missing. #86
Conversation
db9d036
to
e95ae99
Compare
91cfd90
to
e95ae99
Compare
|
If they're not needed at the moment, I would leave them for now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gnutix I'm OK with Year
and YearWeek
, but not Month
and DayOfWeek
for the reasons stated below!
d5e5ef8
to
17ba49c
Compare
Reverted. PR is ready for merge IMHO. |
17ba49c
to
89381c2
Compare
Thank you, @gnutix! To iterate faster and avoid yet another feedback, I took the liberty to update your commits to rename data providers that didn't match the project's standards:
|
Fixes #68 by adding :
YearWeek::parse('2023-W39');
Year::parse('2023');
DayOfWeek::parse('06');
Month::parse('October');
I was not sure it made sense to add
Year::parse()
, because it's so close toYear::of((int) $string)
. But then I realized they do differ for dates (positive and negative) under 1000 / 100 / 10 because of the trailing zeroes :Same forDayOfWeek
with its leading zero. I knowDayOfMonth
andMonth
will be converted into Enums in the next version (0.6), but I still think it doesn't hurt to add these methods on them in the meantime.