You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Chronos FrozenTime is partially overridden in CakePHP I18n.
But Chronos use DateTime format and Cakephp I18n use ICU format and they are very different...
So on CakePHP I18n FrozenTime I can call FrozenTime::createFromFormat but the accepted format is DateTime format and not ICU.
createFromFormat and parseDateTime docs are explicit but we don't really understand why functions are named and mixed this way.
It's just a suggestion but maybe for Cake 4, separation should be clearer between ICU and DateTime. FrozenTime could still handle both formats but be a real abstraction over DateTime and IntlDateFormatter, with explicit names for parsing and formatting functions.
The text was updated successfully, but these errors were encountered:
For output there's already i18nFormat for ICU format I think.
This is what I found :
Functions taking ICU :
parseDateTime
parseDate
parseTime
i18nFormat
Function taking DateTime format :
createFromFormat
format inherited from DateTime
maybe some other inherited functions from DateTime
For formating I think it's ok because $_toStringFormat and $_jsonEncodeFormat are fully overidden, and ICU formatting function start with prefix i18n. I don't think functions like toIso8601String are a problem because they don't take format as argument.
For parsing, maybe the easiest should be to prefix Intl methods with i18n. Or to prefix DateTime methods.
My personnal opinion is that only ICU format should be supported but I'm pretty sure people are still using DateTime format a lot...
This is a (multiple allowed):
Chronos FrozenTime is partially overridden in CakePHP I18n.
But Chronos use DateTime format and Cakephp I18n use ICU format and they are very different...
So on CakePHP I18n
FrozenTime
I can callFrozenTime::createFromFormat
but the accepted format is DateTime format and not ICU.createFromFormat
andparseDateTime
docs are explicit but we don't really understand why functions are named and mixed this way.It's just a suggestion but maybe for Cake 4, separation should be clearer between ICU and DateTime.
FrozenTime
could still handle both formats but be a real abstraction over DateTime and IntlDateFormatter, with explicit names for parsing and formatting functions.The text was updated successfully, but these errors were encountered: