mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-05 12:12:18 +00:00
New code.
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace FireflyIII\Support;
|
||||
|
||||
use Amount;
|
||||
use FireflyIII\Models\TransactionCurrency;
|
||||
use Illuminate\Support\MessageBag;
|
||||
use Input;
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user