Skip to content

Commit 7a9fdac

Browse files
committed
ACP2E-347 - re-added timestamp limitation method, removed only the actual limitation
1 parent a7d3252 commit 7a9fdac

File tree

1 file changed

+13
-1
lines changed
  • lib/internal/Magento/Framework/Data/Form/Element

1 file changed

+13
-1
lines changed

lib/internal/Magento/Framework/Data/Form/Element/Date.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,18 @@ private function isDate(string $value): bool
6666
return !empty($date['year']) && !empty($date['month']) && !empty($date['day']);
6767
}
6868

69+
/**
70+
* initial scope of method, but keeping the method for compatibility:
71+
* If script executes on x64 system, converts large numeric values to timestamp limit
72+
*
73+
* @param int $value
74+
* @return int
75+
*/
76+
protected function _toTimestamp($value)
77+
{
78+
return $value;
79+
}
80+
6981
/**
7082
* Set date value
7183
*
@@ -84,7 +96,7 @@ public function setValue($value)
8496
}
8597
try {
8698
if (preg_match('/^[\-]{0,1}[0-9]+$/', $value)) {
87-
$this->_value = (new \DateTime())->setTimestamp($value);
99+
$this->_value = (new \DateTime())->setTimestamp($this->_toTimestamp($value));
88100
} elseif (is_string($value) && $this->isDate($value)) {
89101
$this->_value = new \DateTime($value, new \DateTimeZone($this->localeDate->getConfigTimezone()));
90102
} else {

0 commit comments

Comments
 (0)