<?php

namespace App\Calendar;

use Carbon\Carbon;
use Acaronlex\LaravelCalendar\Event as CalendarEvent;

class DisabledDayEvent implements CalendarEvent
{
    protected $date;

    public function __construct(string $date)
    {
        $this->date = Carbon::parse($date);
    }

    /**
     * Get the event's id number
     *
     * @return int
     */
    public function getId()
    {
        return 'disabled-'.$this->date->format('Y-m-d');
    }

    /**
     * Get the event's title
     *
     * @return string
     */
    public function getTitle()
    {
        return 'DISABLED';
    }

    /**
     * Is it an all day event?
     *
     * @return bool
     */
    public function isAllDay()
    {
        return true;
    }

    /**
     * Get the start time
     *
     * @return DateTime
     */
    public function getStart()
    {
        return $this->date->startOfDay();
    }

    /**
     * Get the end time
     *
     * @return DateTime
     */
    public function getEnd()
    {
        return $this->date->copy()->endOfDay();
    }

    /**
     * Get the event's options
     *
     * @return array
     */
    public function getEventOptions()
    {
        return [
            'display' => 'background',
            'color' => '#f0f0f0',
            'classNames' => ['fc-disabled-day'],
            'overlap' => false,
            'selectable' => false
        ];
    }
} 