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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T15:09:30+00:00 2026-06-03T15:09:30+00:00

I have following code $("#in").datepicker({ minDate: 0, onSelect: function (dateText, inst) { dateText =

  • 0

I have following code

$("#in").datepicker({
    minDate: 0,
    onSelect: function (dateText, inst) {
        dateText = new Date(dateText);
        dateText = dateText.getDate()+1;
        $('#out').datepicker("option", 'minDate', dateText);
    }
});

Example:
https://jsfiddle.net/ANYTA/1/

However, the out datepicker is adding 10 days instead of 1 day. What could be modified to make it work as intended? thank you very much

  • 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-06-03T15:09:33+00:00Added an answer on June 3, 2026 at 3:09 pm
    dateText = dateText.setDate(dateText.getDate()+1);
    

    NOTE

    somedate.setDate(days);
    
    1. days is integer

    2. Expected values are 1-31, but other values are allowed:

         
    2.1) 0 will result in the last hour of the previous month

       
       2.1) -1 will result in the hour before the last hour of the previous month

    1. when month has 31 days, then 32 will result in the first day of the next month

    2. If month has 30 days then, 32 will result in the second day of the next month


    Your code shoule

    $("#in").datepicker({
        minDate: 0,
        onSelect: function(dateText, inst) {
           var actualDate = new Date(dateText);
           var newDate = new Date(actualDate.getFullYear(), actualDate.getMonth(), actualDate.getDate()+1);
            $('#out').datepicker('option', 'minDate', newDate );
        }
    });
    
    $("#out").datepicker();
    

    DEMO

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

Sidebar

Related Questions

I have the following code that works on Firefox and Chrome $("#adicionarItem").click(function(){ $.ajax({ type:
I have the following code: DirectoryInfo directory = new DirectoryInfo(@"C:\Program Files\Company\Product"); if (!directory.Exists) {
I have the following code: $("#forma_mod_uid").livequery( function (){ $("#forma_mod_uid").ajaxForm({ beforeSubmit: mcargando("#cargando2"), target:'#mod_2', success: ocargando("#cargando2")
I have the following code: JButton button = new JButton("Clear"); button.addActionListener(this); As far as
I have the following jQuery code: $("#someTextInputID").keydown(function(event){ console.log(event.keyCode); console.log("input_box.val(): "+input_box.val()); console.log("input_box.val().length: "+input_box.val().length); }) What
I have the following Python code: cursor.execute("INSERT INTO table VALUES var1, var2, var3,") where
So I have the following code: echo '<li><a href="'.$Website.$Elements[2].'/'.$Row["povezava"].'" class="leftMenuArticlesInactive"></a><li>'; $Website contains: http://www.somesite.com/test/ $Elements[2]
I have following code class User attr_accessor :name end u = User.new u.name =
I have the following code: get_list_a() { $MYSQL -B -u $USER --passwword="$PW" $DB1 <<EOF
I have the following code: get_list_a() { $MYSQL -B -u $USER --passwword="$PW" $DB <<EOF

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.