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

225
Views
How to break datepicker into a three three month grid?

$('#calendar').datepicker({
  numberOfMonths: 12,
  minDate: new Date(2021, 1 - 1, 1),
  maxDate: new Date(2021, 12 - 1, 31),
  showButtonPanel: true,
});
<link rel="stylesheet" href="https://code.jquery.com/ui/1.13.0/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/jquery-3.6.0.js"></script>
<script src="https://code.jquery.com/ui/1.13.0/jquery-ui.js"></script>

<div class="container">
  <div id='calendar'></div>
</div>

This shows all the months on one line.

How can I break datepicker into a 3-by-4 grid, e.g. this layout:

Jan Feb Mar
Apr May Jun
Jul Aug Sep
Oct Nov Dec

I tried adding multiple datepickers, but that's not working.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

How numberOfMonths is used must be an array instead of a whole number to achieve the desired layout.

From the datepicker docs:

enter image description here

So based on that info, use numberOfMonths with an array of row and column values to get the desired grid/matrix.

$('#calendar').datepicker({
  numberOfMonths: [4, 3], // 4 rows, 3 columns
  minDate: new Date(2021, 1 - 1, 1),
  maxDate: new Date(2021, 12 - 1, 31),
  showButtonPanel: true,
});
<link rel="stylesheet" href="https://code.jquery.com/ui/1.13.0/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/jquery-3.6.0.js"></script>
<script src="https://code.jquery.com/ui/1.13.0/jquery-ui.js"></script>

<div class="container">
  <div id='calendar'></div>
</div>

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!