src/constraint/dayofweekcount.js
function(d, val) {
    var month = later.date.prevRollover(d, val, later.dc, later.M),
        dcMax = later.dc.extent(month)[1];

    val = val > dcMax ? dcMax : val || dcMax;

    return later.dc.end(later.date.prev(
      later.Y.val(month),
      later.M.val(month),
      1 + (7 * (val - 1))
    ));
  }
function(d, val) {
    var month = later.date.prevRollover(d, val, later.dc, later.M),
        dcMax = later.dc.extent(month)[1];

    val = val > dcMax ? dcMax : val || dcMax;

    return later.dc.end(later.date.prev(
      later.Y.val(month),
      later.M.val(month),
      1 + (7 * (val - 1))
    ));
  }
function ( d , val ) { var month = later . date . prevRollover ( d , val , later . dc , later . M ) , dcMax = later . dc . extent ( month ) [ 1 ] ; val = val > dcMax ? dcMax : val || dcMax ; return later . dc . end ( later . date . prev ( later . Y . val ( month ) , later . M . val ( month ) , 1 + ( 7 * ( val - 1 ) ) ) ) ; }
Returns the closest previous date with the day of week count specified.

@param {Date} d: The starting date
@param {int} val: The desired value, must be within extent
Returns the closest previous date with the day of week count specified .