static replacer(str, reg, data) {
        return str.replace(reg, function (match, p1, p2, p3) {
            return p1 + data + p3;
        });
    }
Clamps passed date between min and max date
@param {Date} date