Skip to content

Instantly share code, notes, and snippets.

@lramosduarte
Created July 26, 2016 18:36
Show Gist options
  • Save lramosduarte/d74f9ad0ad62d109a85fc58ce8985165 to your computer and use it in GitHub Desktop.
Save lramosduarte/d74f9ad0ad62d109a85fc58ce8985165 to your computer and use it in GitHub Desktop.
Configuração PT-BR datePicker materialize-css
var diaSemana = [ 'Domingo', 'Segunda-Feira', 'Terca-Feira', 'Quarta-Feira', 'Quinta-Feira', 'Sexta-Feira', 'Sabado' ];
var mesAno = [ 'Janeiro', 'Fevereiro', 'Marco', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro' , 'Dezembro' ];
var data = new Date();
var hoje = diaSemana[data.getDay()] + ', ' + mesAno[data.getMonth()] + ' de ' + data.getFullYear();
$("#dataPesquisa").attr("value", hoje);
$(".datepicker").pickadate({
monthsFull: mesAno,
monthsShort: [ 'Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez' ],
weekdaysFull: diaSemana,
weekdaysShort: [ 'Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sab' ],
weekdaysLetter: [ 'D', 'S', 'T', 'Q', 'Q', 'S', 'S' ],
selectMonths: true,
selectYears: true,
clear: false,
format: 'dddd/mm/yyyy',
today: "Hoje",
close: "X",
min: new Date(data.getFullYear() - 1, 0, 1),
max: new Date(data.getFullYear() + 1, 11, 31),
closeOnSelect: true
});
$("#dataPesquisa").click(function (event) {
event.stopPropagation();
$(".datepicker").first().pickadate("picker").open();
});
@lramosduarte
Copy link
Author

Valeu pessoal, vou tentar atualizar depois.

@victornassif
Copy link

Top, salvou umas horinhas aqui kk

@gmoreirasouza
Copy link

Perfeito. Parabéns e agradecido.

@rpgtuca
Copy link

rpgtuca commented Dec 13, 2021

Obrigado.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment