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 7577827
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T17:17:13+00:00 2026-05-30T17:17:13+00:00

It seems a simple thing but i’m unable to solve it and i really

  • 0

It seems a simple thing but i’m unable to solve it and i really need this. How can i add a date to a selected date, through the SelectedDate event?

I need to perform a date range limit on 2 datepickers. Once the user set one datepicker the other needs to only allow date equals to the selected date of the first datepicker, plus one month.

Example: if i set ‘3 of march’ on the first calendar, the second must allow only dates greater than ‘3 of april’.

So far by now i can only get the same selected date or the one i set through $('#dtpicker').datepicker( "setDate" , '+1m');. I tried the jquery-ui documentation example, but nothing.

  • 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-30T17:17:14+00:00Added an answer on May 30, 2026 at 5:17 pm

    I have implemented similar functionality on two datepickers.

    function handleDateChange() {
        var dateStart = $('#datepicker-startdate').datepicker("getDate"), 
            dateEnd = $('#datepicker-enddate').datepicker("getDate");
        if (dateStart !== null) {
            dateStart.setDate(dateStart.getDate() + 1);
            $('#datepicker-enddate').datepicker('option', 'minDate', dateStart);
        }
        if (dateEnd !== null) {
            dateEnd.setDate(dateEnd.getDate() - 1);
            $('#datepicker-enddate').datepicker('option', 'maxDate', dateEnd);
        }
     }
    

    Use this method in the onSelect handler of your datepickers (as init option):

    $(/*your datepicker selector*/).datepicker({
        // ... other init options
        onSelect : function(dateText, inst) {handleDateChange();}
    });
    

    I think this is similar to what you need, if not then it should definitely get you on the right track.

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

Sidebar

Related Questions

Seems like as really simple thing to do, but I just can't track it
This seems like a simple thing, but I can't find an answer in the
This seems like a really simple thing but I haven't figured out how to
It seems that this should be a simple thing but I can't figure it
This seems like a really simple thing to do but I cant't seem to
Seems really a simple thing but can't figure it out. I've been using the
This seems like such a simple thing but I just can't get it to
It seems like such a simple thing, but I can't find any obvious solutions...
This seems simple but I can't figure it out. I receive post data in
Well, it seems simple enough, but I can't find a way to add a

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.