getDayName()
Returns the name of the day of the week for the current date.
Syntax
getDayName(); //returns "Tuesday"
Example
setCanvas(elem);
t=0;
function draw(){
clearCanvas();
dn=getDayName();
if(getTime().h<19 && getTime().h>6){
//draw sun
elem.style.backgroundColor="#D9EDF5";
new circle(100,HEIGHT/2-70,50,'#F7C631',1,'#F4910166',2);
for(i=0;i<2*PI;i+=PI/8){
new line(100+cos(i+t)*55,HEIGHT/2-70+sin(i+t)*55,100+cos(i+t)*70,HEIGHT/2-70+sin(i+t)*70,'#F7C631',3,'round');
}
}
else{
//draw moon
elem.style.backgroundColor="#000022";
new circle(100,HEIGHT/2-70,50,'#ddddff',1,'#F49101',0);
new circle(70,HEIGHT/2-100,60,'#000022',1,'#F49101',0);
}
//draw day's name
new text(200,HEIGHT/2+20,"Happy "+dn+"!",60,'Montserrat',500,'#fff',0,`#009515bb`,'start');
t+=0.01;
requestAnimationFrame(draw);
}
draw()