function looksLikeADate(value) {
  // quick check if value does not look like a date
  if (!value || value.length && !ISO_8601_FORMAT_LENGTHS.includes(value.length) || !looksLikeDateStartRegex.test(value) || !looksLikeDateEndRegex.test(value)) {
    return false;
  } // If it looks like a date we parse the date with a regex to see if we can handle it.
  // momentjs just does regex validation itself if you don't do any operations on it.


  if (typeof value === `string` && quickDateValidateRegex.test(value)) {
    return true;
  }

  return isDate(value);
}
/**
 * looksLikeADate isn't a 100% valid check if it is a real date but at least it's something that looks like a date.
 * It won't catch values like 2010-02-30
 * 1) is it a number?
 * 2) does the length of the value comply with any of our formats
 * 3) does the str starts with 4 digites (YYYY)
 * 4) does the str ends with something that looks like a date
 * 5) Small regex to see if it matches any of the formats
 * 6) check momentjs
 *
 * @param {*} value
 * @return {boolean}
 */
looksLikeADate isn't a 100% valid check if it is a real date but at least it's something that looks like a date.
It won't catch values like 2010-02-30
1) is it a number.
2) does the length of the value comply with any of our formats
3) does the str starts with 4 digites (YYYY)
4) does the str ends with something that looks like a date
5) Small regex to see if it matches any of the formats
6) check momentjs

@param {*} value
@return {boolean}
looksLikeADate isn ' t a 100% valid check if it is a real date but at least it ' s something that looks like a date . It won ' t catch values like 2010 - 02 - 30 1 ) is it a number . 2 ) does the length of the value comply with any of our formats 3 ) does the str starts with 4 digites ( YYYY ) 4 ) does the str ends with something that looks like a date 5 ) Small regex to see if it matches any of the formats 6 ) check momentjs @param { * } value @return { boolean }
function looksLikeADate(value) {
  if (!value || value.length && !ISO_8601_FORMAT_LENGTHS.includes(value.length) || !looksLikeDateStartRegex.test(value) || !looksLikeDateEndRegex.test(value)) {
    return false;
  } 
  if (typeof value === `string` && quickDateValidateRegex.test(value)) {
    return true;
  }
  return isDate(value);
}
function looksLikeADate ( value ) { if ( ! value || value . length && ! ISO_8601_FORMAT_LENGTHS . includes ( value . length ) || ! looksLikeDateStartRegex . test ( value ) || ! looksLikeDateEndRegex . test ( value ) ) { return false ; } if ( typeof value === ` ` && quickDateValidateRegex . test ( value ) ) { return true ; } return isDate ( value ) ; }
looksLikeADate isn't a 100% valid check if it is a real date but at least it's something that looks like a date.
looksLikeADate isn ' t a 100% valid check if it is a real date but at least it ' s something that looks like a date .
// quick check if value does not look like a date // If it looks like a date we parse the date with a regex to see if we can handle it. // momentjs just does regex validation itself if you don't do any operations on it.