Is there a method using either JavaScript or jQuery to determine what day of the week it is? For instance, if the date a user picks in the box is a Sunday, I can alert them.
new Date().getDay(); //0=Sun, 1=Mon, ..., 6=Sat
See also: Javascript Date Object on MDN.
Word of Caution: This returns day of week on the browser. Because the earth is not flat, the day of the week for some users might be different from the day of the week for your server. This may or may not be relevant to your project...
If you are doing a lot of date work, you may want to look into JavaScript date libraries like Datejs or Moment.js
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With