New code.

This commit is contained in:
James Cole
2015-02-22 15:40:13 +01:00
parent 182fe170fd
commit fcbe10f5ec
26 changed files with 708 additions and 180 deletions

View File

@@ -2,7 +2,6 @@
namespace FireflyIII\Support;
use Amount;
use FireflyIII\Models\TransactionCurrency;
use Illuminate\Support\MessageBag;
use Input;

View File

@@ -14,6 +14,33 @@ class Navigation
{
/**
* @param Carbon $date
* @param $repeatFrequency
*
* @return string
* @throws FireflyException
*/
public function periodShow(Carbon $date, $repeatFrequency)
{
$formatMap = [
'daily' => 'j F Y',
'week' => '\W\e\e\k W, Y',
'weekly' => '\W\e\e\k W, Y',
'quarter' => 'F Y',
'month' => 'F Y',
'monthly' => 'F Y',
'year' => 'Y',
'yearly' => 'Y',
];
if (isset($formatMap[$repeatFrequency])) {
return $date->format($formatMap[$repeatFrequency]);
}
throw new FireflyException('No date formats for frequency "' . $repeatFrequency . '"!');
}
/**
* @param $range
* @param Carbon $date