N
N
nickolenko862020-09-24 09:45:28
Yii
nickolenko86, 2020-09-24 09:45:28

How to inflect month names in nominative case in yii2?

Months are displayed in the genitive case. Here is a variable that outputs a list of months

$months = array_map(function ($m) {
return Yii::$app->formatter->asDate(mktime(0, 0, 0, $m, 2, 1970), 'php:F ');
}, range(1, 12));

I would like to know how to inflect months into the nominative case using yii? Using pure php I know how It is displayed

like this5f6c410f83ae1714836197.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Korovin, 2020-11-01
@vakorovin

Make sure that the ICU set of utilities is installed and available on the server, and then a la

Yii::$app->formatter->asDate(date('Y-m-d'), "LLLL")

The list of available formats is here .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question