jeudi 16 novembre 2017

Is there a way to combine/shorten these if statements? [on hold]

Overall I am wanting something done Monday to Friday between 8am and 5pm otherwise outside of that day/timeframe do something else.

This are the different conditions:

if (serverdate.getDay() >= 1 ) {
}

if (serverdate.getHours() >= 17 ) {
}

if (serverdate.getDay() <= 6 ) {
}

if (serverdate.getHours() <= 5 ) {
}

How can I evaluate the conditions together to match my initial requisites?

Thanks for reading!

Aucun commentaire:

Enregistrer un commentaire