date_views_argument_handler_simple::summary_query in core/modules/date/views/date_views_argument_handler_simple.inc
Inject a test for valid date range before the summary query.
views_handler_argument_formula::query in core/modules/views/handlers/views_handler_argument_formula.inc
Build the query based upon the formula
views_handler_argument_formula::summary_query in core/modules/views/handlers/views_handler_argument_formula.inc
Build the summary query based on a formula