Determine if a date is a Saturday or a Sunday using JavaScript

后端 未结 6 1176
忘了有多久
忘了有多久 2020-12-08 01:54

Is it possible to determine if a date is a Saturday or Sunday using JavaScript?

Do you have the code for this?

6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-08 02:23

    var date = new Date();
    var day = date.getDay();
    if(day==0){
    	return false;
        //alert('sunday'); 
    }

提交回复
热议问题