mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-16 09:22:33 +00:00
Replace direct calls to Carbon class.
This commit is contained in:
@@ -145,9 +145,9 @@ trait RequestInformation
|
||||
final protected function notInSessionRange(Carbon $date): bool // Validate a preference
|
||||
{
|
||||
/** @var Carbon $start */
|
||||
$start = session('start', Carbon::now()->startOfMonth());
|
||||
$start = session('start', today(config('app.timezone'))->startOfMonth());
|
||||
/** @var Carbon $end */
|
||||
$end = session('end', Carbon::now()->endOfMonth());
|
||||
$end = session('end', today(config('app.timezone'))->endOfMonth());
|
||||
$result = false;
|
||||
if ($start->greaterThanOrEqualTo($date) && $end->greaterThanOrEqualTo($date)) {
|
||||
$result = true;
|
||||
@@ -175,7 +175,7 @@ trait RequestInformation
|
||||
$attributes['startDate'] = Carbon::createFromFormat('Ymd', $attributes['startDate'])->startOfDay();
|
||||
} catch (InvalidArgumentException $e) {
|
||||
Log::debug(sprintf('Not important error message: %s', $e->getMessage()));
|
||||
$date = Carbon::now()->startOfMonth();
|
||||
$date = today(config('app.timezone'))->startOfMonth();
|
||||
$attributes['startDate'] = $date;
|
||||
}
|
||||
|
||||
@@ -183,7 +183,7 @@ trait RequestInformation
|
||||
$attributes['endDate'] = Carbon::createFromFormat('Ymd', $attributes['endDate'])->endOfDay();
|
||||
} catch (InvalidArgumentException $e) {
|
||||
Log::debug(sprintf('Not important error message: %s', $e->getMessage()));
|
||||
$date = Carbon::now()->startOfMonth();
|
||||
$date = today(config('app.timezone'))->startOfMonth();
|
||||
$attributes['endDate'] = $date;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user