I’m trying to get a text box to change depending on time of day but I can’t get it to work and I’m not sure what I’m doing wrong. I was having a hard time finding time of day related code when googling. Here is what I have:
if(hour >24 <12){ //Customize the hours according to your preference
$w('#greeting').text = 'Good Morning!';
}else {
if(hour >=12 <=17){
$w('#greeting').text = 'Good Afternoon!';
}else {
if(hour >17 <=24){ //Customize the hours according to your preference
$w('#greeting').text = 'Good Evening!';
Basically I want the text to say “good morning” from midnight until noon, “good afternoon” from noon until 5pm, and “good evening” from 5pm until midnight.