Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 759887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:39:03+00:00 2026-05-14T15:39:03+00:00

So if my start date is : 04/22/2010 then my end date selection can

  • 0

So if my start date is : 04/22/2010 then my end date selection can be up to 04/22/2011 and after 04/22/2011 are dates all disabled.

Here is what I have for both selection start and end date:

$(document).ready(function () {      
  $('#endDate').datepicker({ showOn: 'button', 
      buttonImage: '../images/Calendar.png', 
      buttonImageOnly: true, onSelect: function () { }, 
      onClose: function () { $(this).focus(); } 
    }); 

  $('#startDate').datepicker({ showOn: 'button', 
      buttonImage: '../images/Calendar.png', 
      buttonImageOnly: true, onSelect: 
        function (dateText, inst) { 
          $('#endDate').datepicker("option", 'minDate', new Date(dateText)); 
        } 
      , 
      onClose: function () { $(this).focus(); } 
    }); 
}); 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T15:39:03+00:00Added an answer on May 14, 2026 at 3:39 pm

    You can set the maxDate option at the same time, like this:

    $(document).ready(function () {      
      $('#endDate').datepicker({ showOn: 'button', 
          buttonImage: '../images/Calendar.png', 
          buttonImageOnly: true, onSelect: function () { }, 
          onClose: function () { $(this).focus(); } 
      }); 
    
      $('#startDate').datepicker({ showOn: 'button', 
          buttonImage: '../images/Calendar.png', 
          buttonImageOnly: true, 
          onSelect: function (dateText, inst) { 
              var nyd = new Date(dateText);
              nyd.setFullYear(nyd.getFullYear()+1);
              $('#endDate').datepicker("option", { minDate: new Date(dateText), 
                                                   maxDate: nyd });
          }, 
          onClose: function () { $(this).focus(); } 
      }); 
    }); ​
    

    You can play with a working demo here

    This just gets the date, adds a year (don’t use .getYear/.setYear, they’re deprecated) and uses that date to set the maxDate property on the other date picker. If you’re curious, there’s a helpful maintained list of javascript Date methods here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two dates of the form: Start Date: 2010-12-24 End Date: 2011-10-06 (today)
I have a start date and end date field. Both has seperate ajax calender
So I have this array: $dates[0] = array('start'=>'2010-07-22', 'end'=>'2010-07-23'); $dates[1] = array('start'=>'2010-07-22', 'end'=>'0000-00-00'); $dates[2]
How to get start date and end dates in a query from database.
I have start date and end date. I need to find out the day
I have start date and end date. I also have particular day i.e. wednesday.
If I have a start date (say 2009-02-01 ) and an end date (say
I have a class that holds an start date and an end date, normally
Given a table action(start:DATE, length:NUMBER, type:NUMBER), with all records unique, I need to select
I have a start date value to be entered in a textbox in dd/mm/yyyy

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.