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

Translate a date picker and time picker #420

Open
murilogoes opened this issue Mar 29, 2018 · 2 comments
Open

Translate a date picker and time picker #420

murilogoes opened this issue Mar 29, 2018 · 2 comments

Comments

@murilogoes
Copy link

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
});

@murilogoes
Copy link
Author

murilogoes commented Apr 2, 2018

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> 

@brunork26
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants