mirror of
https://github.com/yiisoft/yii2.git
synced 2025-10-29 17:48:15 +08:00
Fix #20083: Fix deprecated warning implicit conversion from float
This commit is contained in:
@ -20,6 +20,7 @@ Yii Framework 2 Change Log
|
||||
- Enh #20042: Add empty array check to `ActiveQueryTrait::findWith()` (renkas)
|
||||
- Enh #20032: Added `yii\helpers\BaseStringHelper::mask()` method for string masking with multibyte support (salehhashemi1992)
|
||||
- Enh #20034: Added `yii\helpers\BaseStringHelper::findBetween()` to retrieve a substring that lies between two strings (salehhashemi1992)
|
||||
- Bug #20083: Fix deprecated warning implicit conversion from float (skepticspriggan)
|
||||
- Enh #20121: Added `yiisoft/yii2-coding-standards` to composer `require-dev` and lint code to comply with PSR12 (razvanphp)
|
||||
- Enh #20134: Raise minimum `PHP` version to `7.3` (@terabytesoftw)
|
||||
- Bug #20141: Update `ezyang/htmlpurifier` dependency to version `4.17` (@terabytesoftw)
|
||||
|
||||
@ -1059,7 +1059,7 @@ class Formatter extends Component
|
||||
} elseif (is_numeric($value)) {
|
||||
$isNegative = $value < 0;
|
||||
$zeroDateTime = (new DateTime())->setTimestamp(0);
|
||||
$valueDateTime = (new DateTime())->setTimestamp(abs($value));
|
||||
$valueDateTime = (new DateTime())->setTimestamp(abs((int) $value));
|
||||
$interval = $valueDateTime->diff($zeroDateTime);
|
||||
} elseif (strncmp($value, 'P-', 2) === 0) {
|
||||
$interval = new DateInterval('P' . substr($value, 2));
|
||||
|
||||
Reference in New Issue
Block a user