Add startofday

This commit is contained in:
James Cole 2020-01-27 19:37:22 +01:00
parent 3711cbd9d7
commit 6655d2e3d0
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E

View File

@ -149,8 +149,8 @@ class RecurrenceController extends Controller
public function suggest(Request $request): JsonResponse
{
$string = $request->get('date') ?? date('Y-m-d');
$today = new Carbon;
$date = Carbon::createFromFormat('Y-m-d', $string);
$today = Carbon::now()->startOfDay();
$date = Carbon::createFromFormat('Y-m-d', $string)->startOfDay();;
$preSelected = (string)$request->get('pre_select');
Log::debug(sprintf('date = %s, today = %s. date > today? %s', $date->toAtomString(), $today->toAtomString(), var_export($date > $today, true) ));