mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-10 12:24:50 +00:00
Better call to date.
This commit is contained in:
@@ -49,7 +49,7 @@ abstract class AbstractCronjob
|
||||
public function __construct()
|
||||
{
|
||||
$this->force = false;
|
||||
$this->date = new Carbon;
|
||||
$this->date = today(config('app.timezone'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -84,9 +84,9 @@ class ExportDataGenerator
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->start = new Carbon;
|
||||
$this->start = today(config('app.timezone'));
|
||||
$this->start->subYear();
|
||||
$this->end = new Carbon;
|
||||
$this->end = today(config('app.timezone'));
|
||||
$this->exportTransactions = false;
|
||||
$this->exportAccounts = false;
|
||||
$this->exportBudgets = false;
|
||||
|
||||
@@ -54,7 +54,7 @@ trait FormSupport
|
||||
/** @var Carbon $date */
|
||||
$date = null;
|
||||
try {
|
||||
$date = new Carbon;
|
||||
$date = today(config('app.timezone'));
|
||||
} catch (Exception $e) {
|
||||
$e->getMessage();
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ trait GetConfigurationData
|
||||
$first = session('first');
|
||||
$title = sprintf('%s - %s', $start->formatLocalized($this->monthAndDayFormat), $end->formatLocalized($this->monthAndDayFormat));
|
||||
$isCustom = true === session('is_custom_range', false);
|
||||
$today = new Carbon;
|
||||
$today = today(config('app.timezone'));
|
||||
$ranges = [
|
||||
// first range is the current range:
|
||||
$title => [$start, $end],
|
||||
|
||||
@@ -288,7 +288,7 @@ trait PeriodOverview
|
||||
$range = app('preferences')->get('viewRange', '1M')->data;
|
||||
$first = $this->journalRepos->firstNull();
|
||||
$start = null === $first ? new Carbon : $first->date;
|
||||
$end = $theDate ?? new Carbon;
|
||||
$end = $theDate ?? today(config('app.timezone'));
|
||||
|
||||
Log::debug(sprintf('Start for getNoCategoryPeriodOverview() is %s', $start->format('Y-m-d')));
|
||||
Log::debug(sprintf('End for getNoCategoryPeriodOverview() is %s', $end->format('Y-m-d')));
|
||||
|
||||
@@ -71,7 +71,7 @@ class TransactionGroupTwig extends AbstractExtension
|
||||
->whereNull('deleted_at')
|
||||
->first();
|
||||
if (null === $entry) {
|
||||
return new Carbon;
|
||||
return today(config('app.timezone'));
|
||||
}
|
||||
|
||||
return new Carbon(json_decode($entry->data, false));
|
||||
|
||||
Reference in New Issue
Block a user