Yii Framework Forum: Traduzir data yii2 - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Traduzir data yii2 Rate Topic: -----

#1 User is offline   Edson Rodrigues 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 423
  • Joined: 10-August 10

Posted 28 February 2017 - 05:59 PM

Pessoal estou com um problema na tradução de data, alguem poderia me ajudar:

web.php
 'language' => 'pt_BR',
...
 'components' => [
        ...
        
        'formatter' => [            
            'dateFormat' => 'dd/MM/YYYY',
            'datetimeFormat' => 'dd/MM/yyyy H:i',
            'timeFormat' => 'H:i',
            'decimalSeparator' => ',',
            'thousandSeparator' => '.',
            'currencyCode' => 'R$',
        ],
....


view:

 $formater = Yii::$app->formatter;
      echo $formater->asDate('2017-10-10 12:12', 'long');


resultado: October 10, 2017

Como pode ser não esta traduzindo, alguem poderia me ajudar...já até usei setlocale(LC_ALL, 'pt_BR'); e nada.
0

#2 User is offline   Aryel Santos 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 39
  • Joined: 26-April 13

Posted 01 March 2017 - 12:02 PM

Você instalou a extensão PHP intl?
0

#3 User is offline   Edson Rodrigues 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 423
  • Joined: 10-August 10

Posted 04 March 2017 - 11:31 AM

View PostAryel Santos, on 01 March 2017 - 12:02 PM, said:

Você instalou a extensão PHP intl?



Era isso mesmo...valew brodi!
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users