code: function quarterFormat() {
  
    const format = function(d) {
      return formats.year.data(d) + "q" + formatQuarter(d);
    };
  
    format.parse = function(dateString) {
      const matchedDate = dateString.match(/^(\d{4})q(\d)$/);
      return matchedDate ? getDateFromQuarter(matchedDate[1], matchedDate[2]) : null;
    };
  
    const formatQuarter = function(d) {
      if (!(d instanceof Date)) d = new Date(+d);
      return ((d.getUTCMonth() / 3) | 0) + 1;
    };
  
    const getDateFromQuarter = function(p1, p2) {
      const quarter = parseInt(p2);
      const month = 3 * quarter - 2; // first month in quarter
      const year = p1;
      return formats.month.data.parse([year, (month < 9 ? "0" : "") + month].join("-"));
    };
  
    return format;
  }
docs: /*
  Quarter Format to format and parse quarter dates
  A quarter is the month%3
  Follows format: YYYYqQ: 2015q4, 5847q1, 0040q2