Some tests and a rename.

This commit is contained in:
James Cole
2014-12-30 17:55:46 +01:00
parent 1f0e692ee2
commit 9f92e1b7bd
15 changed files with 150 additions and 45 deletions

View File

@@ -44,7 +44,7 @@ class ReportController extends BaseController
try {
new Carbon($year . '-' . $month . '-01');
} catch (Exception $e) {
View::make('error')->with('message', 'Invalid date');
return View::make('error')->with('message', 'Invalid date');
}
$date = new Carbon($year . '-' . $month . '-01');
$dayEarly = clone $date;
@@ -81,7 +81,7 @@ class ReportController extends BaseController
try {
new Carbon($year . '-' . $month . '-01');
} catch (Exception $e) {
View::make('error')->with('message', 'Invalid date');
return View::make('error')->with('message', 'Invalid date.');
}
$date = new Carbon($year . '-' . $month . '-01');
$subTitle = 'Report for ' . $date->format('F Y');
@@ -110,7 +110,7 @@ class ReportController extends BaseController
try {
new Carbon('01-01-' . $year);
} catch (Exception $e) {
App::abort(500);
return View::make('error')->with('message', 'Invalid date.');
}
$date = new Carbon('01-01-' . $year);
$end = clone $date;