index.js
function createdDate(key, value, prop) {
  var val = prop ? get(value, prop) : value;
  var str = val || key;

  var re = /^(\d{4})-(\d{2})-(\d{2})/;
  var m = re.exec(str);
  if (!m) return null;
  return String(m[1]) + String(m[2]) + String(m[3]);
}
function createdDate(key, value, prop) {
  var val = prop ? get(value, prop) : value;
  var str = val || key;

  var re = /^(\d{4})-(\d{2})-(\d{2})/;
  var m = re.exec(str);
  if (!m) return null;
  return String(m[1]) + String(m[2]) + String(m[3]);
}
function createdDate ( key , value , prop ) { var val = prop ? get ( value , prop ) : value ; var str = val || key ; var re = / ^(\d{4})-(\d{2})-(\d{2}) / ; var m = re . exec ( str ) ; if ( ! m ) return null ; return String ( m [ 1 ] ) + String ( m [ 2 ] ) + String ( m [ 3 ] ) ; }
Get the date from a specified property or key.

@param  {String} `key` Key used as the fallback when the property is not on the value.
@param  {Object} `value` Object to use when finding the property.
@param  {String} `prop` Property string to use to get the date.
@return {String} Date string in the format `YYYYMMDD` (e.g. 20150618)
Get the date from a specified property or key .