-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Fixed Datetime Error on Newsletter Template #15783
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
Fixed Datetime Error on Newsletter Template #15783
Conversation
@@ -335,10 +335,16 @@ public function formatDateTime( | |||
*/ | |||
public function convertConfigTimeToUtc($date, $format = 'Y-m-d H:i:s') | |||
{ | |||
$zendFormat = $this->getDateTimeFormat(\IntlDateFormatter::MEDIUM); | |||
$zendDate = new \Zend_Date($date, $zendFormat, $this->_localeResolver->getLocale()); |
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.
Zend_Date
must not be used, there were separate efforts to get rid of it.
Please rewrite implementation using only native PHP functions.
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.
I tried using PHP function but all function return same error while we add date like 29/giu/2016 01:22:19. I refer Magento 1 code and try to fix it. This error is throw by PHP function.
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.
@patelnimesh1988 please go this way: #11306 (comment) Use something locale-aware from intl
.
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.
Okay
Closing due to inactivity. Feel free to reach me out anytime later if you wish to continue work on this pull request and it will be reopened. |
I am working on this issue |
@orlangur Please check my new changes. |
@orlangur Is this solution okay? |
\IntlDateFormatter::FULL, | ||
'GMT', | ||
\IntlDateFormatter::GREGORIAN, | ||
'dd-MM-yyyy H:i:s' |
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.
Can we skip some values here? Why timezone is GMT? Why $format
is not used?
Hi @patelnimesh1988 , I am closing this PR now due to inactivity. |
Fixed Datetime Error on Newsletter Template
Description
While save Queue Newsletter Queue Date Start Magento throw DateTime parse error. I have fixed that issue using Zend_Date class
Fixed Issues (if relevant)
Manual testing scenarios
Contribution checklist