datePicker.minDate not working

Hi, i have a datePicker, and i want to control it with a checkBox, if checked i want to change minDate to 1 day of the month, if not checked i need minDate = today, i have 2 functions in a backend module that return each date in this format:

“2018-02-01T04:06:14.103Z”
“2018-02-17T04:06:15.207Z”

but i use this code display the date but don’t change min date in the picker:
export function checkbox1_change(event, $w) {
var startDate;
var checkBox = $w(“#checkbox1”);
let date = $w(“#datePicker1”);

if(checkBox.checked){ 
    getFirstDay().then(product => { 
            date.minDate = product; 
            console.log(product); 
        }) 
    .catch(error => { 
     	console.log(error); 
    }); 
}else{ 
	today().then(product =>{ 
		date.minDate = product; 
		console.log(product); 
 	}) 
    .catch(error => { 
     	console.log(error); 
    }); 
} 

this is the console output when i check - uncheck the checkBox:

“2018-02-01T04:06:14.103Z”
“2018-02-17T04:06:15.207Z”

do i need a different date format maybe? haven’t find any example…
Thanks in advance.

Hi,

can you please explain why you are using code in the backend to return the dates rather than in the browser?
the date you need to set should be of the following format:

Shlomi

I have the javascript in the backend, because if i use it directly in the page i got errors.

can you please share the url of the site you are working on?