code: function GedcomXDate(str) {
  
    if(str == '') {
      throw new Error('Invalid Date');
    }
  
    if(str.charAt(0) == 'R') {
      return new Recurring(str);
    } else if(/\//.test(str)) {
      return new Range(str);
    } else if(str.charAt(0) == 'A') {
      return new Approximate(str);
    } else {
      return new Simple(str);
    }
  }
docs: A GedcomX Date.
  This will parse the passed in string and return
  the appropriate GedcomX Date object.