Skip to content

Commit

Permalink
[locale] Capitalization of pt month names (#4557)
Browse files Browse the repository at this point in the history
* Updated pt-br tests

* Update pt-br.js

* Update pt-br.js

* Updated PT tests

* Updated pt-js month names capitalization
  • Loading branch information
cassmtnr authored and marwahaha committed Jan 19, 2019
1 parent 4331b79 commit 91550f8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/locale/pt.js
Expand Up @@ -5,8 +5,8 @@
import moment from '../moment';

export default moment.defineLocale('pt', {
months : 'janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro'.split('_'),
monthsShort : 'jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez'.split('_'),
months : 'Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro'.split('_'),
monthsShort : 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez'.split('_'),
weekdays : 'Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado'.split('_'),
weekdaysShort : 'Dom_Seg_Ter_Qua_Qui_Sex_Sáb'.split('_'),
weekdaysMin : 'Do_2ª_3ª_4ª_5ª_6ª_Sá'.split('_'),
Expand Down
20 changes: 10 additions & 10 deletions src/test/locale/pt.js
Expand Up @@ -4,7 +4,7 @@ import moment from '../../moment';
localeModule('pt');

test('parse', function (assert) {
var tests = 'janeiro jan_fevereiro fev_março mar_abril abr_maio mai_junho jun_julho jul_agosto ago_setembro set_outubro out_novembro nov_dezembro dez'.split('_'), i;
var tests = 'Janeiro Jan_Fevereiro Fev_Março Mar_Abril Abr_Maio Mai_Junho Jun_Julho Jul_Agosto Ago_Setembro Set_Outubro Out_Novembro Nov_Dezembro Dez'.split('_'), i;
function equalTest(input, mmm, i) {
assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
}
Expand All @@ -23,9 +23,9 @@ test('parse', function (assert) {

test('format', function (assert) {
var a = [
['dddd, MMMM Do YYYY, h:mm:ss a', 'Domingo, fevereiro 14º 2010, 3:25:50 pm'],
['dddd, MMMM Do YYYY, h:mm:ss a', 'Domingo, Fevereiro 14º 2010, 3:25:50 pm'],
['ddd, hA', 'Dom, 3PM'],
['M Mo MM MMMM MMM', '2 2º 02 fevereiro fev'],
['M Mo MM MMMM MMM', '2 2º 02 Fevereiro Fev'],
['YYYY YY', '2010 10'],
['D Do DD', '14 14º 14'],
['d do dddd ddd', '0 0º Domingo Dom'],
Expand All @@ -39,13 +39,13 @@ test('format', function (assert) {
['[the] DDDo [day of the year]', 'the 45º day of the year'],
['LTS', '15:25:50'],
['L', '14/02/2010'],
['LL', '14 de fevereiro de 2010'],
['LLL', '14 de fevereiro de 2010 15:25'],
['LLLL', 'Domingo, 14 de fevereiro de 2010 15:25'],
['LL', '14 de Fevereiro de 2010'],
['LLL', '14 de Fevereiro de 2010 15:25'],
['LLLL', 'Domingo, 14 de Fevereiro de 2010 15:25'],
['l', '14/2/2010'],
['ll', '14 de fev de 2010'],
['lll', '14 de fev de 2010 15:25'],
['llll', 'Dom, 14 de fev de 2010 15:25']
['ll', '14 de Fev de 2010'],
['lll', '14 de Fev de 2010 15:25'],
['llll', 'Dom, 14 de Fev de 2010 15:25']
],
b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
i;
Expand Down Expand Up @@ -92,7 +92,7 @@ test('format ordinal', function (assert) {
});

test('format month', function (assert) {
var expected = 'janeiro jan_fevereiro fev_março mar_abril abr_maio mai_junho jun_julho jul_agosto ago_setembro set_outubro out_novembro nov_dezembro dez'.split('_'), i;
var expected = 'Janeiro Jan_Fevereiro Fev_Março Mar_Abril Abr_Maio Mai_Junho Jun_Julho Jul_Agosto Ago_Setembro Set_Outubro Out_Novembro Nov_Dezembro Dez'.split('_'), i;
for (i = 0; i < expected.length; i++) {
assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);
}
Expand Down

0 comments on commit 91550f8

Please sign in to comment.