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.