Skip to content

Commit

Permalink
Merge pull request #117 from firegento/sprankhub-patch-1
Browse files Browse the repository at this point in the history
Fixe datetime attributes
  • Loading branch information
sprankhub authored Aug 12, 2021
2 parents 711b7f1 + 9a0a096 commit 462127f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Model/Import/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -1219,7 +1219,7 @@ protected function saveCategories()
$attrValue = $attrParams['options'][strtolower($attrValue)];
}
} elseif ('datetime' == $attribute->getBackendType() && strtotime($attrValue)) {
$attrValue = (new \DateTime(strtotime($attrValue)))->format(DateTime::DATETIME_PHP_FORMAT);
$attrValue = (new \DateTime($attrValue))->format(DateTime::DATETIME_PHP_FORMAT);
} elseif ($backModel && 'available_sort_by' != $attrCode) {
$attribute->getBackend()->beforeSave($category);
$attrValue = $category->getData($attribute->getAttributeCode());
Expand Down

0 comments on commit 462127f

Please sign in to comment.