lib/utils.js
function getDate (dateString) {
  var date = new Date(dateString);

  if (Object.prototype.toString.call(date) === '[object Date]' && !isNaN(date.getTime())) {
    return date;
  }

  //try to fix invalid date
  date = fixInvalidDate(dateString);

  //if date still isn't valid there's not more we can do..
  if (!isNaN(date.getTime())) {
    return date;
  }
}
function getDate (dateString) {
  var date = new Date(dateString);

  if (Object.prototype.toString.call(date) === '[object Date]' && !isNaN(date.getTime())) {
    return date;
  }

  //try to fix invalid date
  date = fixInvalidDate(dateString);

  //if date still isn't valid there's not more we can do..
  if (!isNaN(date.getTime())) {
    return date;
  }
}
function getDate ( dateString ) { var date = new Date ( dateString ) ; if ( Object . prototype . toString . call ( date ) === '[object Date]' && ! isNaN ( date . getTime ( ) ) ) { return date ; } //try to fix invalid date date = fixInvalidDate ( dateString ) ; //if date still isn't valid there's not more we can do.. if ( ! isNaN ( date . getTime ( ) ) ) { return date ; } }
Parses a date string to a date

@param dateString
Parses a date string to a date