Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[locale] Capitalization of pt month names #4557

Merged
merged 5 commits into from Jan 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/locale/pt-br.js
Expand Up @@ -5,8 +5,8 @@
import moment from '../moment';

export default moment.defineLocale('pt-br', {
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
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-br.js
Expand Up @@ -4,7 +4,7 @@ import moment from '../../moment';
localeModule('pt-br');

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 @@ -25,9 +25,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 @@ -41,13 +41,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 às 15:25'],
['LLLL', 'Domingo, 14 de fevereiro de 2010 às 15:25'],
['LL', '14 de Fevereiro de 2010'],
['LLL', '14 de Fevereiro de 2010 às 15:25'],
['LLLL', 'Domingo, 14 de Fevereiro de 2010 às 15:25'],
['l', '14/2/2010'],
['ll', '14 de fev de 2010'],
['lll', '14 de fev de 2010 às 15:25'],
['llll', 'Dom, 14 de fev de 2010 às 15:25']
['ll', '14 de Fev de 2010'],
['lll', '14 de Fev de 2010 às 15:25'],
['llll', 'Dom, 14 de Fev de 2010 às 15:25']
],
b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
i;
Expand Down Expand Up @@ -94,7 +94,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
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