Skip to content

Commit 2d4aa69

Browse files
committed
Merge remote-tracking branch 'origin/MAGETWO-51881-catalog-events-carousel-widget' into PR_Branch
2 parents e581092 + 5e19956 commit 2d4aa69

File tree

2 files changed

+5
-5
lines changed
  • dev/tests/functional/tests/app/Magento/Backend/Test/Fixture/Source
  • lib/internal/Magento/Framework/Stdlib/DateTime/Filter

2 files changed

+5
-5
lines changed

dev/tests/functional/tests/app/Magento/Backend/Test/Fixture/Source/Date.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Class Date.
1313
*
1414
* Data keys:
15-
* - pattern (Format a local time/date with delta, e.g. 'm-d-Y -3 days' = current day - 3 days)
15+
* - pattern (Format a local time/date with delta, e.g. 'm/d/Y -3 days' = current day - 3 days)
1616
*/
1717
class Date extends DataSource
1818
{

lib/internal/Magento/Framework/Stdlib/DateTime/Filter/DateTime.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ public function __construct(\Magento\Framework\Stdlib\DateTime\TimezoneInterface
3737
*
3838
* @param string $value
3939
* @return string
40-
* @throws LocalizedException
40+
* @throws \Exception
4141
*/
4242
public function filter($value)
4343
{
4444
try {
45-
$value = new \DateTime($value);
46-
return $value->format('Y-m-d H:i:s');
45+
$dateTime = new \DateTime($value);
46+
return $dateTime->format('Y-m-d H:i:s');
4747
} catch (\Exception $e) {
48-
throw new \Exception('Invalid input datetime format');
48+
throw new \Exception("Invalid input datetime format of value '$value'", $e->getCode(), $e);
4949
}
5050
}
5151
}

0 commit comments

Comments
 (0)