Created
July 26, 2016 18:36
-
-
Save lramosduarte/d74f9ad0ad62d109a85fc58ce8985165 to your computer and use it in GitHub Desktop.
Configuração PT-BR datePicker materialize-css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Obrigado.