-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Convert string to DateTime object for languages other than English #18083
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
Changes from 6 commits
ae42612
c4fa85b
6bda779
a4f80a9
14d9528
da580fc
16a7f0b
9315dd6
42cd228
ddeaf36
6cc9034
28617c0
fd0ab03
1b03c19
c6c2ffe
502e5ac
51e8fe7
a8c7768
127b1b8
526bfc9
edc962d
4fe8c7a
e27de55
0d0c210
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -80,6 +80,7 @@ public function scopeDate($scope = null, $date = null, $includeTime = false); | |
|
|
||
| /** | ||
| * Get scope timestamp | ||
| * | ||
| * Timestamp will be built with scope timezone settings | ||
| * | ||
| * @param mixed $scope | ||
|
|
@@ -121,6 +122,7 @@ public function getConfigTimezone($scopeType = null, $scopeCode = null); | |
| public function isScopeDateInInterval($scope, $dateFrom = null, $dateTo = null); | ||
|
|
||
| /** | ||
| * | ||
| * @param string|\DateTimeInterface $date | ||
| * @param int $dateType | ||
| * @param int $timeType | ||
|
|
@@ -139,10 +141,29 @@ public function formatDateTime( | |
| ); | ||
|
|
||
| /** | ||
| * Convert date from config timezone to Utc. | ||
| * | ||
| * If pass \DateTime object as argument be sure that timezone is the same with config timezone | ||
| * | ||
| * @param string|\DateTimeInterface $date | ||
| * @param string $format | ||
| * @throws LocalizedException | ||
| * @return string | ||
| * @since 100.1.0 | ||
| * @deprecated | ||
| */ | ||
| public function convertConfigTimeToUtc($date, $format = 'Y-m-d H:i:s'); | ||
|
|
||
| /** | ||
| * Convert date from config timezone to Utc. | ||
| * | ||
| * If pass \DateTime object as argument be sure that timezone is the same with config timezone | ||
| * | ||
| * @param string|\DateTimeInterface $date | ||
| * @param string $format | ||
| * @param string $pattern | ||
| * @throws LocalizedException | ||
| * @return string | ||
| * @deprecated | ||
| */ | ||
| public function convertConfigTimeToUtcWithPattern($date, $format = 'Y-m-d H:i:s', $pattern = 'Y-m-d H:i:s'); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding a public method into interface marked as API is backward incompatible and therefore is forbidden (please look BIC guide https://devdocs.magento.com/guides/v2.3/contributor-guide/backward-compatible-development/). Please reimplement it. You can use the possible approach how to do that in the mentioned guide. |
||
| } | ||
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.
You shouldn't duplicate descriptions in the implementation. They are in the interface. Please return them to
{@inheritdoc}Uh oh!
There was an error while loading. Please reload this page.
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.
Thank you for the explanation @slavvka . So should I just ignore these warnings then?
https://travis-ci.org/magento/magento2/jobs/429304963
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.
Basically you could ignore those since {@inheritdoc} may be used in such cases and there's a bug in our sniffer. But it would be good if you make changes according to this guide https://devdocs.magento.com/guides/v2.3/coding-standards/docblock-standard-general.html#inheritdoc. As you could see there should be enough to remove curly braces {}