My coupon checking codewars program has an unexplained error

function checkCoupon(enteredCode, correctCode, currentDate, expirationDate) {
  const months = 'January February March April May June July August September October November December'.split(' ');
  if (enteredCode != correctCode) return false;
  
  if (Number(currentDate.split(' ')[2]) > Number(expirationDate.split(' ')[2])) return false;
  
  else if (Number(currentDate.split(' ')[2]) == Number(expirationDate.split(' ')[2])) {
    for (let x = 0; x < months.length; x++) {
      if (months[x] == currentDate.split(' ')[0]) {
        for (let y = 0; y < months.length; y++) {
          if (months[y] == expirationDate.split(' ')[0]) {
            if (x > y) return false;
            else if (x == y) {
              if (Number(currentDate.split(' ')[1].replace(',', '')) > Number(expirationDate.split(' ')[1].replace(',', ''))) return false;
              else return true;
            }
            else return true;
          }
        }
      }
    }
  }
  
  else return true;
}

I’m doing a 7 kyu codewars kata called “The coupon code” and the program I’ve made completes all of the tests except three. All 3 of them say they expected false and instead got true. I’ve tried to see the problem in my code for over 45 minutes, but haven’t made any progress because codewars doesn’t allow users to see the conditions of the tests, only the outputs. I’m aware that there is a Date object within JavaScript that I could use to remedy this problem. I intentionally opted against using this for the sake of developing problem solving skills. Does anyone have advice that could help nudge me in the right direction?