Better call to date.

This commit is contained in:
James Cole
2020-09-11 07:12:33 +02:00
parent 0b308cb5f2
commit 284222c2ee
33 changed files with 46 additions and 46 deletions

View File

@@ -144,7 +144,7 @@ class RecurrenceFormRequest extends FormRequest
*/
public function rules(): array
{
$today = new Carbon;
$today = today(config('app.timezone'));
$tomorrow = Carbon::now()->addDay();
$rules = [
// mandatory info for recurrence.

View File

@@ -151,7 +151,7 @@ class ReportFormRequest extends FormRequest
*/
public function getEndDate(): Carbon
{
$date = new Carbon;
$date = today(config('app.timezone'));
$range = $this->get('daterange');
$parts = explode(' - ', (string) $range);
if (2 === count($parts)) {
@@ -179,7 +179,7 @@ class ReportFormRequest extends FormRequest
*/
public function getStartDate(): Carbon
{
$date = new Carbon;
$date = today(config('app.timezone'));
$range = $this->get('daterange');
$parts = explode(' - ', (string) $range);
if (2 === count($parts)) {