I have a form where the user can select a date using a series of dropdowns for Month, Day, Year. Upon selecting them all I want to test it to make sure that the date selected is not today's date, nor a weekend date, if so, I want to show them an alert and return them to the form to make an adjustment.

The code below is working fine for the weekend test, and when I use the alert to show me what values are being created I see that both tripDate and todaysDate SHOW me the same values, IF test is not working (just for todays test, the weekend test is working).

Hoping someone much more familiar in javascript (which is pretty much anyone other than me, I compiled this from several google searches and a VERY basic understanding of javascript) can point out to me what I am overlooking.

Thank you for your assistance!


<script type="text/javascript">
  function isTodayorWeekend() {
    var todaysDate = new Date();
    var tripDate = new Date();
    alert('Today is: ' + todaysDate + '\n' + 'Trip Date: ' + tripDate);
    if(tripDate.getDay() == 6 || tripDate.getDay() == 0 || tripDate == todaysDate)
      alert('Not today or weekends!');