I'm having difficulty figuring out how to add a date range to my report. Ideally I want the report to show all records in a 24-hour period.
This is what I have so far:
class DailyReport extends SS_Report {
// the name of the report
public function title() {
return 'Auckland List';
}
// what we want the report to return
public function sourceRecords($params = null) {
return NomineeList::get()->where(array(
'"Venue"' => 'Auckland'
))->sort('Shared');
}
function parameterFields() {
$fields = DateField::create('Created', 'Report Day');
return $fields;
}
// which fields on that object we want to show
public function columns() {
$fields = array(
'RunnersFirstName' => 'First Name',
'RunnersLastName' => 'Last Name',
'RunnersEmail' => 'Email',
'Address' => 'Address',
'Message' => 'Message',
'Name' => 'Nominated by',
'Email' => 'Nominator\'s Email',
'Shared' => 'Shared'
);
return $fields;
}
}