File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
app/code/Magento/Eav/Model/Entity/Attribute/Backend Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 7
7
namespace Magento \Eav \Model \Entity \Attribute \Backend ;
8
8
9
9
/**
10
+ * Prepare date for save in DB
11
+ *
10
12
* @api
11
13
* @since 100.0.2
12
14
*/
@@ -61,8 +63,8 @@ public function beforeSave($object)
61
63
/**
62
64
* Prepare date for save in DB
63
65
*
64
- * string format used from input fields (all date input fields need apply locale settings)
65
- * int value can be declared in code (this meen whot we use valid date)
66
+ * String format is used in input fields (all date input fields need apply locale settings)
67
+ * int (Unix) format can be used in other parts of the code
66
68
*
67
69
* @param string|int|\DateTimeInterface $date
68
70
* @return string
@@ -72,7 +74,7 @@ public function formatDate($date)
72
74
if (empty ($ date )) {
73
75
return null ;
74
76
}
75
- // unix timestamp given - simply instantiate date object
77
+ // Unix timestamp given - simply instantiate date object
76
78
if (is_scalar ($ date ) && preg_match ('/^[0-9]+$/ ' , $ date )) {
77
79
$ date = (new \DateTime ())->setTimestamp ($ date );
78
80
} elseif (!($ date instanceof \DateTimeInterface)) {
You can’t perform that action at this time.
0 commit comments