Advertisement
Guest User

Untitled

a guest
Apr 20th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. function checkDate() {
  2. //First if statement checks that day is within 1 and 31, the maximum and minumum amount of days in a month
  3. if (birthDay >= 1 && birthDay <= 31) {
  4. //Ensures that the entered day is possible for said month.
  5. if ( birthMonth == "January" || birthMonth == "March" || birthMonth == "May" || birthMonth == "July" || birthMonth== "August" || birthMonth == "October" || birthMonth== "December" && birthDay<=31 ) {
  6. validDate = 1;
  7. }
  8. if (birthMonth == "February" && birthDay<=29 ) {
  9. validDate = 1;
  10. }
  11. if (birthMonth == "April" && birthDay<=30 ) {
  12. validDate = 1;
  13. }
  14. } else {
  15. //If not a real day, valid date is set to zero
  16. validDate = 0;
  17. }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement