protected function statementDays()
{
$firstStatement = \DB::collection('statements');
if ($this->has_lrs) {
$firstStatement->where('lrs_id', new \MongoId($this->lrs));
}
$firstStatement = $firstStatement->orderBy("timestamp")->first();
if ($firstStatement) {
$firstDay = date_create(gmdate("Y-m-d", strtotime($firstStatement['statement']['timestamp'])));
$today = date_create(gmdate("Y-m-d", time()));
$interval = date_diff($firstDay, $today);
$days = $interval->days + 1;
return $days;
} else {
return '';
}
}