How can I load invalid dates from database?

Hello,

How can I load invalid dates from database ?

this not working:

(async () => {
  try {
    const data = await fetch('http://127.0.0.1/pages/data.php', {
      headers: {
        'Content-Type': 'application/json'
      }
    });
    const res = await data.json();

    const obj = {
      start: res.start,
      end: res.end
    }

    if(res) {
      mobiscroll.datepicker('#demo', {
      controls: ['calendar', 'time'],
      selectMultiple: true,
      min: new Date(),
      invalid: [
        obj
      ], 
      display: 'inline'
    });
    }
  } catch(e) {
    console.log('ERRR')
    console.error(e);
  }
})();

Hi @Cenk_Kan!

Can you also share what does the res variable hold? What will the obj object value be?

Thanks