Hi Folks, I am trying to write an if statement and not sure of the syntax. Basically I want to say
If DAY of DATE VALUE in the DATE PICKER is MONDAY then do this…
I am just using a standard date picker. Thanks in advance.
Hi Folks, I am trying to write an if statement and not sure of the syntax. Basically I want to say
If DAY of DATE VALUE in the DATE PICKER is MONDAY then do this…
I am just using a standard date picker. Thanks in advance.
$w.onReady(() => {
$w('#dataPicker').onChangeEvent(event => {
const date = new Date(event.target.value);
const dayOfTheWeek = date.getDay();//Sunday is 0, Saturday is 6.
if(dayOfTheWeek === 3/*if Wednesday*/){
//do something...
}
})
})
Thanks so much bud