Shifted min/max date range settings to PostgreSQL so we can take advantage of LEAST and GREATEST functions.