Carbon locale not respected?

前端 未结 1 723
攒了一身酷
攒了一身酷 2021-01-21 05:55

In my Laravel 6 app, I have Carbon::now()->locale() returning it as it should be.

As confirmation that the locale is loaded, Carbon::n

相关标签:
1条回答
  • 2021-01-21 06:36

    Apparently, formatLocalized() is somehow deprecated or not working as intended.

    From the Carbon docs:

    You also may know formatLocalized() method from Carbon 1. This method still works > the same in Carbon 2 but you should better use isoFormat() instead.

    Carbon::now()->isoFormat('MMMM') is working as intended and correctly returns febbraio.

    0 讨论(0)
提交回复
热议问题