lib/query.utils.js
function addAndWhereDate(queryBuilder, column, from, to) {
  if (from && to) {
    queryBuilder.whereBetween(column, [from, to]);
  } else if (from) {
    queryBuilder.andWhere(column, '>=', from);
  } else if (to) {
    queryBuilder.andWhere(column, '<=', to);
  }
}
function addAndWhereDate(queryBuilder, column, from, to) {
  if (from && to) {
    queryBuilder.whereBetween(column, [from, to]);
  } else if (from) {
    queryBuilder.andWhere(column, '>=', from);
  } else if (to) {
    queryBuilder.andWhere(column, '<=', to);
  }
}
Appends WHERE conditions to query builder based on given date parameters
@param {Object} queryBuilder - knex querybuilder instance. Mutated during this operation
@param {string} column
@param {Date} from
@param {Date} to