lib/jsdom/living/helpers/dates-and-times.js
function parseDateString(str) {
  const matches = dateRe.exec(str);
  if (!matches) {
    return null;
  }
  const year = Number(matches[1]);
  if (year <= 0) {
    return null;
  }
  const month = Number(matches[2]);
  if (month < 1 || month > 12) {
    return null;
  }
  const day = Number(matches[3]);
  if (day < 1 || day > numberOfDaysInMonthOfYear(month, year)) {
    return null;
  }
  return { year, month, day };
}
function parseDateString(str) {
  const matches = dateRe.exec(str);
  if (!matches) {
    return null;
  }
  const year = Number(matches[1]);
  if (year <= 0) {
    return null;
  }
  const month = Number(matches[2]);
  if (month < 1 || month > 12) {
    return null;
  }
  const day = Number(matches[3]);
  if (day < 1 || day > numberOfDaysInMonthOfYear(month, year)) {
    return null;
  }
  return { year, month, day };
}
function parseDateString ( str ) { const matches = dateRe . exec ( str ) ; if ( ! matches ) { return null ; } const year = Number ( matches [ 1 ] ) ; if ( year <= 0 ) { return null ; } const month = Number ( matches [ 2 ] ) ; if ( month < 1 || month > 12 ) { return null ; } const day = Number ( matches [ 3 ] ) ; if ( day < 1 || day > numberOfDaysInMonthOfYear ( month , year ) ) { return null ; } return { year , month , day } ; }
https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#parse-a-date-string
https : // html . spec . whatwg . org / multipage / common - microsyntaxes . html#parse - a - date - string