html - Setting up a JavaScript that writes whether the store is Open or Closed -


i'm trying setup basic javascript, if day sunday or saturday, write "closed" in html, or if it's later 5:30pm, or it's earlier 9:00am, write out closed.

my main problem if statement seems return true. i've tried multiple things fix , no avail. appreciated.

code: http://pastebin.com/r5ke6fx6

this not complete answer, more advanced comment on code styling.

your if statements complicated, still dont understand them. improve code make more readable. makes easier , improve it. example:

status="opened";  if(date=="wednesday"){     if(time>closetime){         status="closed. late";     }     if(time<opentime){         status="closed. youre early";     } } else {     //code other dates }  //echo code document.write(status); 

Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -