From 38bc38bf267eb7a6da941bb599fb8fef44e1669f Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 25 Sep 2015 17:28:42 +0200 Subject: [PATCH] Add some period things. --- app/Support/Navigation.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/Support/Navigation.php b/app/Support/Navigation.php index 773addd142..50e0faf2b3 100644 --- a/app/Support/Navigation.php +++ b/app/Support/Navigation.php @@ -109,14 +109,18 @@ class Navigation public function endOfX(Carbon $theCurrentEnd, $repeatFreq, Carbon $maxDate = null) { $functionMap = [ + '1D' => 'endOfDay', 'daily' => 'endOfDay', + '1W' => 'endOfWeek', 'week' => 'endOfWeek', 'weekly' => 'endOfWeek', 'month' => 'endOfMonth', '1M' => 'endOfMonth', 'monthly' => 'endOfMonth', + '3M' => 'lastOfQuarter', 'quarter' => 'lastOfQuarter', 'quarterly' => 'lastOfQuarter', + '1Y' => 'endOfYear', 'year' => 'endOfYear', 'yearly' => 'endOfYear', ]; @@ -146,13 +150,17 @@ class Navigation public function periodShow(Carbon $date, $repeatFrequency) { $formatMap = [ + '1D' => '%e %B %Y', 'daily' => '%e %B %Y', + '1W' => 'Week %W, %Y', 'week' => 'Week %W, %Y', 'weekly' => 'Week %W, %Y', + '3M' => '%B %Y', 'quarter' => '%B %Y', '1M' => '%B %Y', 'month' => '%B %Y', 'monthly' => '%B %Y', + '1Y' => '%Y', 'year' => '%Y', 'yearly' => '%Y', @@ -220,10 +228,12 @@ class Navigation public function subtractPeriod(Carbon $theDate, $repeatFreq, $subtract = 1) { $date = clone $theDate; - + // 1D 1W 1M 3M 6M 1Y $functionMap = [ + '1D' => 'subDays', 'daily' => 'subDays', 'week' => 'subWeeks', + '1W' => 'subWeeks', 'weekly' => 'subWeeks', 'month' => 'subMonths', '1M' => 'subMonths',