<commit_before><?php

namespace App\Presenters;

use App\Models\Appointment;
use McCool\LaravelAutoPresenter\BasePresenter;

class AppointmentPresenter extends BasePresenter
{
    public function __construct(Appointment $resource)
    {
        $this->wrappedObject = $resource;
    }

    public function code()
    {
        $length = $this->wrappedObject->business->pref('appointment_code_length');

        return strtoupper(substr($this->wrappedObject->hash, 0, $length));
    }

    public function date()
    {
        return $this->wrappedObject->start_at->timezone($this->wrappedObject->business->timezone)->toDateString();
    }

    public function time()
    {
        return $this->wrappedObject->start_at->timezone($this->wrappedObject->business->timezone)->toTimeString();
    }

    public function diffForHumans()<commit_msg>Enhance Appointment time display format<commit_after><?php

namespace App\Presenters;

use App\Models\Appointment;
use McCool\LaravelAutoPresenter\BasePresenter;

class AppointmentPresenter extends BasePresenter
{
    public function __construct(Appointment $resource)
    {
        $this->wrappedObject = $resource;
    }

    public function code()
    {
        $length = $this->wrappedObject->business->pref('appointment_code_length');

        return strtoupper(substr($this->wrappedObject->hash, 0, $length));
    }

    public function date()
    {
        return $this->wrappedObject
                    ->start_at
                    ->timezone($this->wrappedObject->business->timezone)
                    ->toDateString();
    }

    public function time()
    {
        return $this->wrappedObject
                    ->start_at
                    ->timezone($this->wrappedObject->business->timezone)
                    ->format(env('DISPLAY_TIME_FORMAT', 'h:i A'));
    }

    public function diffForHumans()
{'fraction_non_alphanumeric': 0.12010723860589813, 'fraction_numerical': 0.0010723860589812334, 'mean_word_length': 2.8794178794178795, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4426215', 'n_tokens_mistral': 544, 'n_tokens_neox': 523, 'n_words': 89}