diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index 7cb5f7c1cf..5c13470f40 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -145,6 +145,7 @@ Yii Framework 2 Change Log - Enh #2646: Added support for specifying hostinfo in the pattern of a URL rule (qiangxue) - Enh #2661: Added boolean column type support for SQLite (qiangxue) - Enh #2670: Changed `console\Controller::globalOptions()` to `options($actionId)` to (make it possible to) differentiate options per action (hqx) +- Enh #2714: Added support for formatting time intervals relative to the current time with `yii\base\Formatter` (drenty) - Enh #2729: Added `FilterValidator::skipOnArray` so that filters like `trim` will not fail for array inputs (qiangxue) - Enh #2735: Added support for `DateTimeInterface` in `Formatter` (ivokund) - Enh #2756: Added support for injecting custom `isEmpty` check for all validators (qiangxue) diff --git a/framework/base/Formatter.php b/framework/base/Formatter.php index a10e0b1840..1cc22f4406 100644 --- a/framework/base/Formatter.php +++ b/framework/base/Formatter.php @@ -479,7 +479,7 @@ class Formatter extends Component * - an integer representing a UNIX timestamp * - a string that can be parsed into a UNIX timestamp via `strtotime()` or that can be passed to a DateInterval constructor. * - a PHP DateTime object - * - a PHP DateInterval object + * - a PHP DateInterval object (a positive time interval will refer to the past, a negative one to the future) * * @return string the formatted result */