Date input field to another date input field

Hello!So the scenario is basically just transferring the date of a date picker input , to another page using wixLocation.to and query.
So i tried converting the day to ISO format ( 2017-08-12 ) but i still get errors…

1st Page
This from the first page, i just create the redirect link with the query .The toformat i created it to make the date ISO format.


2nd Page
The page that the results are transferred to is this:# checkin and # checkout are both date inputs.


I’m getting this error.

Before i tried using the ISO format, i just used the default that wix had,but i still got errors:

I’m not sure what format it actually wants :smiley: If a wix stuff can take a quick look at it please!!!

Hi Maria,

Please see my sample:
1st page:

   import wixLocation from 'wix-location';
   
   $w.onReady(function () {
   	$w("#datePicker1").onChange((event) => {
   		console.log(event.target.value);
   		let mydate = event.target.value;
   		$w("#datePicker2").value = mydate;
   		wixLocation.to('/mydatepage?param=' + mydate);
   	});
   });

2nd page:

import wixLocation from 'wix-location';

$w.onReady(function () {

	let query = wixLocation.query;
	
	console.log(query.param);

	$w("#datePicker1").value =new Date(query.param);
});

You just need to update your code on the second page (new Date() is missing here):

$w("#checkin").value = new Date(checkin);

Thanks.

Thank you Alexander!!