InfomediaLtd/angular2-materialize

Translate a date picker and time picker

Opened this issue · 2 comments

I have to translate the date picker visualization to brazilian portuguese, and would like to know how I have to code this jquery example below using angular2-materialize:

$('.datepicker').pickadate({
monthsFull: ['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro'],
monthsShort: ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez'],
weekdaysFull: ['Domingo', 'Segunda', 'Terça', 'Quarta', 'Quinta', 'Sexta', 'Sabádo'],
weekdaysShort: ['Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sab'],
today: 'Hoje',
clear: 'Limpar',
close: 'Pronto',
labelMonthNext: 'Próximo mês',
labelMonthPrev: 'Mês anterior',
labelMonthSelect: 'Selecione um mês',
labelYearSelect: 'Selecione um ano',
selectMonths: true,
selectYears: 15
});

Hello,

I've solved this problem using the params in this format:

<div class="input-field col s6 m6 l6">
  <input materialize="pickadate" 
        type="text" class="datepicker" placeholder="Selecione a Data" formControlName="data" 
        [materializeParams]="[{selectMonths: true, selectYears: true,
                                labelMonthNext: 'Próximo Mês',
                                labelMonthPrev: 'Mês anterior',
                                labelMonthSelect: 'Selecione um mês',
                                labelYearSelect: 'Selecione um ano',
                                today: 'Hoje',
                                clear: 'Apagar',
                                close: 'Fechar',
                                monthsFull: [ 'Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro' ],
                                monthsShort: [ 'Jan', 'Fev', 'Mar', 'Abr', 'Maio', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez' ],
                                weekdaysFull: [ 'Domingo', 'Segunda', 'Terça', 'Quarta', 'Quinta', 'Sexta', 'Sábado' ],
                                weekdaysShort: [ 'Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sáb' ],
                                weekdaysLetter: [ 'D', 'S', 'T', 'Q', 'Q', 'S', 'S' ],
                                format: 'dd/mm/yyyy'                                   
        }]">
  <label> Data </label>
</div> 

Was searching for datepicker materalizeParams when I found your post, thanks man.