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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T14:23:46+00:00 2026-05-14T14:23:46+00:00

I am using Jquery Date pickers to get Start and End Dates for an

  • 0

I am using Jquery Date pickers to get Start and End Dates for an application I am building.

I have two datepickers, one for a start date and one for an end date.

When someone clicks a date in the start date picker I need that date to be appended automatically to the end date picker.

I also need the end date picker to select future dates only from the date that has been appended to it.

There are two demos on the jquery datepicker site that do what I want, but I am unsure how to combine them to both do what I want.

Example One:

This example shows how you can tie
two date pickers together so that the
date selected in one influences the
dates that can be selected in the
other

$(function()
{
    $('.date-pick').datePicker()
    $('#start-date').bind(
        'dpClosed',
        function(e, selectedDates)
        {
            var d = selectedDates[0];
            if (d) {
                d = new Date(d);
                $('#end-date').dpSetStartDate(d.addDays(1).asString());
            }
        }
    );
    $('#end-date').bind(
        'dpClosed',
        function(e, selectedDates)
        {
            var d = selectedDates[0];
            if (d) {
                d = new Date(d);
                $('#start-date').dpSetEndDate(d.addDays(-1).asString());
            }
        }
    );
});

Example Two:

An example showing inline date pickers
which are linked together and trigger
behaviour in each other…

$(function()
{
    $('#date-view1')
        .datePicker({inline:true})
        .bind(
            'dateSelected',
            function(e, selectedDate, $td)
            {
                $('#date1').val(selectedDate.asString());
                $('#date-view2, #date-view3').dpSetSelected(selectedDate.addDays(3).asString());
            }
        );
    $('#date-view2')
        .datePicker({inline:true})
        .bind(
            'dateSelected',
            function(e, selectedDate, $td)
            {
                $('#date2').val(selectedDate.asString());
            }
        );
    $('#date-view3').datePicker();
    $('#form-check')
        .bind(
            'click',
            function()
            {
                alert('date1=' + $('#date1').val() + '\n' + 'date2=' + $('#date2').val());
            }
        );
});

I have tried many combinations of the codes listed above, but I have not been able to get the desired results.

Thanks for all your help,

Tim

  • 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-14T14:23:46+00:00Added an answer on May 14, 2026 at 2:23 pm

    here try this, select start date will append whatever value in start-date input and set the end date to start date :

    $('#start-date').bind('dpClosed', function(e, selectedDates) {
        var d = selectedDates[0];
        if (d) {
       d = new Date(d);
       $('#end-date').dpSetStartDate(d.addDays(1).asString()).dpSetSelected(d.asString()).val($(this).val());
      }
     });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 531k
  • Answers 531k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Hello I think what ArneRie meant was rather $this->_forward("success","user","booking",$values); method.Solved… May 16, 2026 at 11:58 pm
  • Editorial Team
    Editorial Team added an answer oh, I see.. you're printing your array and this is… May 16, 2026 at 11:58 pm
  • Editorial Team
    Editorial Team added an answer Make sure that: you are not setting the value again… May 16, 2026 at 11:58 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I am using jquery ui datepicker in order to populate start and end dates
I'm setting the start date of an event using jQuery UI Datepicker. Now I
I have an asp.net mvc calendar application (using jquery ui datepicker) and i am
I'm using the JQuery DatePicker to have the user pick a date and have
So I'm using the jQuery date picker, and it works well. I am using
I am using the jQuery Date Range Picker by the filament group . My
I am using jQuery Datepicker and I have a little problem. If the datepicker
Hi i am using jquery-ui datepicker to select date and date.js to find difference
I am using JQuery ui with datepicker and when a user tabs on to
I am using jquery's datepicker where a list of items is populated from an

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.