Closed gnutix closed 1 year ago
Instant
and Interval(Instant, Instant)
don't have parse methods either. Not sure if it would make sense to add them or not. WDYT ?
Instant
andInterval(Instant, Instant)
don't have parse methods either. Not sure if it would make sense to add them or not. WDYT ?
If they're not needed at the moment, I would leave them for now.
I'm OK with Year and YearWeek, but not Month and DayOfWeek for the reasons stated below!
Reverted. PR is ready for merge IMHO.
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:
providerParseInvalidYearThrowsException
providerParseInvalidYearWeekThrowsException
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 for
DayOfWeek
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.~