function opigno_lrs_stats_statements_date_between in Opigno TinCan API 7
Filter statements that happened between two dates
Parameters
array $statements:
Return value
array
3 calls to opigno_lrs_stats_statements_date_between()
- opigno_lrs_stats_filter_current_month_statements in modules/
opigno_tincan_api_stats/ includes/ model/ filters.inc - Filter statements that happened this month
- opigno_lrs_stats_filter_current_week_statements in modules/
opigno_tincan_api_stats/ includes/ model/ filters.inc - Filter statements that happened this week
- opigno_lrs_stats_filter_current_year_statements in modules/
opigno_tincan_api_stats/ includes/ model/ filters.inc - Filter statements that happened this year
File
- modules/
opigno_tincan_api_stats/ includes/ model/ filters.inc, line 17 - Implements functions to filter statements
Code
function opigno_lrs_stats_statements_date_between($statements, $first_date, $last_date) {
$filtered_statements = array();
foreach ($statements as $statement) {
if ($statement->timestamp >= $first_date && $statement->timestamp <= $last_date) {
$filtered_statements[] = $statement;
}
}
return $filtered_statements;
}