_parseDates = function() {

  const _fmt = require('./fluent-date').fmt;
  const that = this;

  // TODO: refactor recursion
  var replaceDatesInObject = function( obj ) {

    if (!obj) { return; }
    if (Object.prototype.toString.call( obj ) === '[object Array]') {
      obj.forEach(elem => replaceDatesInObject( elem ));
      return;
    } else if (typeof obj === 'object') {
      if (obj._isAMomentObject || obj.safe) {
        return;
      }
      Object.keys( obj ).forEach(key => replaceDatesInObject(obj[key]));
      ['start','end','date'].forEach(function(val) {
        if ((obj[val] !== undefined) && (!obj.safe || !obj.safe[val])) {
          obj.safe = obj.safe || { };
          obj.safe[ val ] = _fmt(obj[val]);
          if (obj[val] && (val === 'start') && !obj.end) {
            obj.safe.end = _fmt('current');
            return;
          }
        }
      });
      return;
    }
  };
  Object.keys( this ).forEach(function(member) {
    replaceDatesInObject(that[member]);
  });
}
Convert human-friendly dates into formal Moment.js dates for all collections.
We don't want to lose the raw textual date as entered by the user, so we store
the Moment-ified date as a separate property with a prefix of .safe. For ex:
job.startDate is the date as entered by the user. job.safeStartDate is the
parsed Moment.js date that we actually use in processing.