I was able to limit the month and year by using
if (( 0 < userAccPDM && userAccPDM <= 12 )); then
accPDM=$userAccPDM && break
echo "Try again!" && read -p "Month: " userAccPDM
if (( userAccPDY <= curYr )); then
accPDY=$userAccPDY && break
echo "Try again!" && read -p "Year: " userAccPDY
You can use date to check if date is valid.
date "+%d/%m/%Y" -d "dd/mm/yyyy" > /dev/null 2>&1 ret=$?
ret is not
0, then date is valid