title: check if date argument is in yyyy-mm-dd format and correct date range
body: <p>Is there a way to check if a date argument is in the correct date range eg </p>
  
  <blockquote>
    <p>2016-10-32 or 2016-09-31 should display as invalid</p>
  </blockquote>
  
  <p>.</p>
  
  <p>i can able to find correct argument yyyy-mm-dd using below code</p>
  
  <pre><code>if [[ $1 =~ ^[0-9]{4}-[0-9]{2}-[0-9]{2}$ ]]
  then echo "Date $1 is in valid format (YYYY-MM-DD)"
  else echo "Date $1 is in an invalid format (not YYYY-MM-DD)"
  fi
  </code></pre>
  
  <p>How to check date is in correct date range</p>