Edit --- This is how I made it work:
disableDayFn: function (date) {
var dia = ('0' + date.getDate()).slice(-2);
var mes = ('0' + (date.getMonth() + 1)).slice(-2);
var ano = date.getFullYear();
var dataFormatada = dia + '/' + mes + '/' + ano;
if (dataFormatada == '08/12/2018') {
return date;
}
if (dataFormatada == '25/12/2018') {
return date;
}
}
I hope it helps anyone in the future!
I'm trying to disable holidays on materialize picker, but I have no idea on how to do so, could you please help?
The next holiday is on 20/11/2018 and then 28/11/2018, could you use it as exemple?
Thank you all!
<div class="row">
<div class="input-field col s12">
<input type="text" class="datepicker" id="vencimento">
<label for="vencimento" class="active">Vencimento</label>
<span class="helper-text">É necessário enviar a solicitação no mínimo cinco dias úteis antes do vencimento.</span>
</div>
</div>
$('.datepicker').datepicker({
i18n: {
months: ['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'],
weekdays: ['Domingo', 'Segunda', 'Terça', 'Quarta', 'Quinta', 'Sexta', 'Sabádo'],
weekdaysShort: ['Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sab'],
weekdaysAbbrev: ['D', 'S', 'T', 'Q', 'Q', 'S', 'S'],
today: 'Hoje',
clear: 'Limpar',
cancel: 'Sair',
done: 'Confirmar',
labelMonthNext: 'Próximo mês',
labelMonthPrev: 'Mês anterior',
labelMonthSelect: 'Selecione um mês',
labelYearSelect: 'Selecione um ano',
selectMonths: true,
selectYears: 15,
},
disableWeekends: true,
format: 'dd/mm/yyyy',
container: 'body',
minDate: window.date.addDays(7),
});
This is how my code is, I'm translating it to PT-BR. What I need is to block some holidays, because this should be only work on work days. I checked that there is a function called disableDayFn, but I don't know how to use it properly.