> 
> **Possible Duplicate:**  
> 
> [how to determine if date is weekend in javascript](https://stackoverflow.com/questions/3551795/how-to-determine-if-date-is-weekend-in-javascript) 
> 
> 
> 

I'm tryng to do something for checkinf onload if date is a weekend or not, I wtitten this code.

```
<script type="text/javascript">
function getdate()
{
    var items = new Array();
    var itemCount = document.getElementsByClassName("date");

    for(var i = 0; i < itemCount.length; i++)
    {
        items[i] = document.getElementById("date" + (i+1)).value;
    }

    return items;
}
</script>   

```

This script will be executed onLoad, but I don't know how to check if dates are weekend or not What I would like to do is that if a date is satturday or sunday to change it for monday. 

I've done this using php doing an array and changing it but using php is not adapted for that.