Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

332
Visualizações
hide/disable year from HTML date input

Is there a way to hide (mm-dd) or disable (YYYY-mm-0000) the year input from the field? I tried this, but it shows the actual date. If so I need to show 0000

var year = new Date().getFullYear();
document.getElementById('date').setAttribute("min", year + "-01-01");
document.getElementById('date').setAttribute("max", year + "-12-31");
<input type="date" id="date" />

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

After searching for an hours,I found jquery datepicker can do the trick.

 var date = new Date();

$(function() {
    $( "#datepicker" ).datepicker({
    dateFormat: "dd-M",
      changeMonth: true,

       minDate:  new Date(date.getFullYear(), 0,1),                                            
       maxDate: new Date(date.getFullYear(), 12,31)
    });
  });
.ui-datepicker-year
{
 display:none;   
}
 <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />

<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>

<input type="text" id="datepicker">

you can use https://jqueryui.com/datepicker/ to find out more about jquery datepicker

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda