copy()->setTimezone($this->timezones->resolve($viewer))->toDateString(); } /** * The instant a submitted value actually names. * * A bare `YYYY-MM-DD` is a calendar day and means the end of it where * the setter is — what every date input posts. Anything carrying a * time is an instant somebody named on purpose and is stored as it * arrives: the API can express a moment, and a date input cannot. */ public function instant(?string $value, ?User $setter): ?Carbon { if ($value === null) { return null; } return preg_match('/^\d{4}-\d{2}-\d{2}$/', $value) === 1 ? LocalDay::end($value, $this->timezones->resolve($setter)) : Carbon::parse($value); } }