jQueryUI - Datepicker - Multiple Months

Discussion in 'JavaScript' started by theextelligence, Dec 29, 2010.

  1. #1
    Hi

    I was playing around with the jQuery Multiple months plugin and was wondering if there was anyway I could display 4 months in it with 2 months on top and the other two months at bottom.

    OR

    If that is not possible then can we display 2 different instance of calendars something like this screenshot but changing the month on either one would change the other two months of the other calendar at the same time.

    [​IMG]


    If anyone can help, i will be greateful.

    Thanks in advance
     
    theextelligence, Dec 29, 2010 IP
  2. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Sure, use an array instead of a single value for the numberOfMonths parameter.
    
    <script type="text/javascript">
    $(function() {
       $( "#datepicker" ).datepicker({ numberOfMonths: [2, 2] });
    });
    </script>
    
    Code (markup):
    There are only two buttons for changing the months, but I think that is better than four buttons.
     
    Cash Nebula, Dec 30, 2010 IP
  3. theextelligence

    theextelligence Member

    Messages:
    50
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #3
    Thanks so much

    That works like a charm :)
     
    theextelligence, Dec 30, 2010 IP
  4. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Yeah, I love datepicker. They put a lot of work into making it configurable.

    Cheers mate! :)
     
    Cash Nebula, Dec 30, 2010 IP