lib/utils.js
function fixInvalidDate(dateString) {
  if (!dateString) {
    return;
  }

  //Convert invalid dates' timezones to GMT using timezoneMap
  dateString = dateString.replace(/BST?/i, function (match) {
    return timezoneMap[match];
  });

  //Some dates come in as ET, CT etc.. and some don't have the correct offset.
  //Matches /ET/EDT/EST/CT/CDT/CST/MT/MDT/MST/PT/PDT/PST if found at the end of a date string
  var newDateString = dateString.replace(/(E|C|M|P)[DS+]?T$/i, function (match) {
    var firstChar = match.charAt(0);
    return isDaylightSavingsTime() ? (firstChar + 'DT') : (firstChar + 'ST');
  });

  return new Date(newDateString);
}
function fixInvalidDate(dateString) {
  if (!dateString) {
    return;
  }

  //Convert invalid dates' timezones to GMT using timezoneMap
  dateString = dateString.replace(/BST?/i, function (match) {
    return timezoneMap[match];
  });

  //Some dates come in as ET, CT etc.. and some don't have the correct offset.
  //Matches /ET/EDT/EST/CT/CDT/CST/MT/MDT/MST/PT/PDT/PST if found at the end of a date string
  var newDateString = dateString.replace(/(E|C|M|P)[DS+]?T$/i, function (match) {
    var firstChar = match.charAt(0);
    return isDaylightSavingsTime() ? (firstChar + 'DT') : (firstChar + 'ST');
  });

  return new Date(newDateString);
}
function fixInvalidDate ( dateString ) { if ( ! dateString ) { return ; } //Convert invalid dates' timezones to GMT using timezoneMap dateString = dateString . replace ( / BST? / i , function ( match ) { return timezoneMap [ match ] ; } ) ; //Some dates come in as ET, CT etc.. and some don't have the correct offset. //Matches /ET/EDT/EST/CT/CDT/CST/MT/MDT/MST/PT/PDT/PST if found at the end of a date string var newDateString = dateString . replace ( / (E|C|M|P)[DS+]?T$ / i , function ( match ) { var firstChar = match . charAt ( 0 ) ; return isDaylightSavingsTime ( ) ? ( firstChar + 'DT' ) : ( firstChar + 'ST' ) ; } ) ; return new Date ( newDateString ) ; }
Attempts to fix invalid dates coming in from different feeds

@param dateString
@returns {Date}
Attempts to fix invalid dates coming in from different feeds