function commerce_reports_handler_field_date::pre_query in Commerce Reporting 7.3
Makes sure a start and end date are set
Overrides views_handler::pre_query
File
- includes/
views/ commerce_reports_handler_field_date.inc, line 197 - Views field handler for the created date on orders.
Class
- commerce_reports_handler_field_date
- @file Views field handler for the created date on orders.
Code
function pre_query() {
// If no endDate is set, set it to today.
if (empty($this->endDate)) {
$this->endDate = $this
->convertTimestamp(time());
}
// If no startDate is set, set it to the end date minus the default period.
if (empty($this->startDate)) {
$this->startDate = $this
->convertTimestamp($this->endDate - $this->options['default_period']);
}
}