File tree Expand file tree Collapse file tree 2 files changed +4
-20
lines changed
dev/tests/integration/testsuite/Magento/Framework/Data/Form/Element
lib/internal/Magento/Framework/Data/Form/Element Expand file tree Collapse file tree 2 files changed +4
-20
lines changed Original file line number Diff line number Diff line change @@ -50,9 +50,9 @@ public function testGetValue(array $data, string $expect): void
50
50
*/
51
51
public function getValueDataProvider (): array
52
52
{
53
- $ stringDates = ['2020-05-18 12:08:16 ' , '1920-10-25 10:10:10 ' ];
54
- $ testTimestamps = [strtotime ($ stringDates [0 ]), strtotime ($ stringDates [1 ])];
55
- $ dates = [new \DateTime ($ stringDates [0 ]), new \DateTime ($ stringDates [1 ])];
53
+ $ stringDates = ['2020-05-18 12:08:16 ' , '1920-10-25 10:10:10 ' , ' 2122-01-11 10:30:00 ' ];
54
+ $ testTimestamps = [strtotime ($ stringDates [0 ]), strtotime ($ stringDates [1 ]), strtotime ( $ stringDates [ 2 ]) ];
55
+ $ dates = [new \DateTime ($ stringDates [0 ]), new \DateTime ($ stringDates [1 ]), new \ DateTime ( $ stringDates [ 2 ]) ];
56
56
$ data = [];
57
57
foreach ($ testTimestamps as $ key => $ testTimestamp ) {
58
58
$ data [$ key ] = [
Original file line number Diff line number Diff line change @@ -66,22 +66,6 @@ private function isDate(string $value): bool
66
66
return !empty ($ date ['year ' ]) && !empty ($ date ['month ' ]) && !empty ($ date ['day ' ]);
67
67
}
68
68
69
- /**
70
- * If script executes on x64 system, converts large numeric values to timestamp limit
71
- *
72
- * @param int $value
73
- * @return int
74
- */
75
- protected function _toTimestamp ($ value )
76
- {
77
- $ value = (int )$ value ;
78
- if ($ value > 3155760000 ) {
79
- $ value = 0 ;
80
- }
81
-
82
- return $ value ;
83
- }
84
-
85
69
/**
86
70
* Set date value
87
71
*
@@ -100,7 +84,7 @@ public function setValue($value)
100
84
}
101
85
try {
102
86
if (preg_match ('/^[\-]{0,1}[0-9]+$/ ' , $ value )) {
103
- $ this ->_value = (new \DateTime ())->setTimestamp ($ this -> _toTimestamp ( $ value) );
87
+ $ this ->_value = (new \DateTime ())->setTimestamp ($ value );
104
88
} elseif (is_string ($ value ) && $ this ->isDate ($ value )) {
105
89
$ this ->_value = new \DateTime ($ value , new \DateTimeZone ($ this ->localeDate ->getConfigTimezone ()));
106
90
} else {
You can’t perform that action at this time.
0 commit comments