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
Formatter asDate() return wrong number #16539
Comments
|
Not supported by ICU and already mentioned in code. I guess this should work as equivalent
|
What is the reason of converting PHP date format to ICU? |
To use features of |
What features? |
Here is implementation. Locale based date parsing. |
Any example? I still can't imagine situation where I want to specify format using |
Well, I agree with you. |
@cebe implemented it... |
you can use the PHP format if you want, but you can not use every PHP formatting feature. Intl formatter is better in formatting dates locale-aware. The format conversion is used if you use jquery data picker and similar stuff on the frontend, some use php format, jquery even has its own format, so we allow specifying the format in different ways so that backend and frontend as well as validator use the same specification. In the case of this issue there is no point in using the Yii formatter, if you only need the number of days in the current month, you can just use |
@cebe It still does not explain what is the point of converting PHP format to ICU. If someone wants to use |
I need the number of days in the persian calendar.
|
it's simply not supported by intl. Not sure there is a way to add it. If anyone has ideas about how we can add it feel free to propose ideas. |
Won't be implemented in 2.0. |
\Yii::$app->formatter->asDate(time(), 'php:t')
return current date.I think formatter should return number of days in the current month.
echo \Yii::$app->formatter->asDate(time(), 'php:t')
What is the expected result?
31
What do you get instead?
20180719 09:49 PM
Additional info
The text was updated successfully, but these errors were encountered: