It's working properly on local server, but when I upload it to the shared host, instead of displaying relative date it shows raw string.
code:
Yii::$app->formatter->asRelativeTime($timestamp, 'now');
local host:
in 6 days
shared host:
in {delta, plural, =1{a day} other{# days}}
Locale is set and timestamp is being passed. Intl extension is enabled. Other formatter functions (i.e. asDate) are working properly.
I guess it was because of outdated ICU library of PHP intl extension. Mine was 4.2.1, while yii2 requires at least ICU version 49 to be able to use all the features, which probably include asRelativeTime().
Cannot say for sure because I'm unable to update it on my hosting plan.