bootstrap 3 date picker

Hi all,
the following link displays a date selector with a date rage http://www.wrightairservice.com/cms/date-demo.html
I would like to configure the second date field and selector so that it displays the date that was selected in the first field.
Can anyone assist?
Cheers,
N
LVL 5
Neil_BradleyWeb UX/UI DeveloperAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Julian HansenCommented:
Put an event hanlder on the first date field to catch the changeDate event and then set the second datepicker to the first's value - something like this

	$('#dp').datepicker()
		.on('changeDate', function(e) {
			$('#dp2').val($(this).val());
		});

Open in new window

Sample here
Neil_BradleyWeb UX/UI DeveloperAuthor Commented:
This will set the selected date of the first field in the field of the next but does not pass on a value into the date picker calendar itself.
It needs to be something like
	.on('changeDate', function(e) {
			
			$('.input-daterange input[name="RDate"]').datepicker("setDate", "The new date");
		});

Open in new window

Julian HansenCommented:
Then change to
$('#dp').datepicker()
.on('changeDate', function(e) {
  $('#dp2').datepicker('setDate',$(this).val());
});

Open in new window

Online sample updated with the above (http://www.marcorpsa.com/ee/t846.html)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Neil_BradleyWeb UX/UI DeveloperAuthor Commented:
Awesome! Great work thank you..
Julian HansenCommented:
You are most welcome.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
jQuery

From novice to tech pro — start learning today.