Skip to content

Commit

Permalink
https://github.com/canadasatellite-ca/site/issues/249
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrii-fediuk committed Oct 12, 2021
1 parent c77e672 commit 7226327
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,15 @@ protected function formatValues($values)
{
if (isset($values[$this->getOption()->getId()])) {
$value = $values[$this->getOption()->getId()];
$dateTime = \DateTime::createFromFormat(DateTime::DATETIME_PHP_FORMAT, $value);
# 2021-10-12 Dmitry Fedyuk https://www.upwork.com/fl/mage2pro
# "`Cart2Quote_Features`: «DateTime::createFromFormat() expects parameter 2 to be string, array given
# in vendor/magento/module-catalog/Model/Webapi/Product/Option/Type/Date.php on line 34»":
# https://github.com/canadasatellite-ca/site/issues/249
try {$dateTime = \DateTime::createFromFormat(DateTime::DATETIME_PHP_FORMAT, $value);}
catch (\Exception $e) {
df_log_e($e, null, ['v' => $value]);
throw $e;
}
$values[$this->getOption()->getId()] = [
'date' => $value,
'year' => $dateTime->format('Y'),
Expand Down

0 comments on commit 7226327

Please sign in to comment.