Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

331
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!