@extends('admin.layouts.app')
@php
$isEdit = $event->exists;
// Admins type and read BUSINESS time (Asia/Riyadh); storage is UTC. The
// request converts on the way in — this converts on the way back out, so
// the value an admin sees in the field is the value they typed.
$tz = \App\Support\Time\BookingsTimezone::business();
$startsValue = old('starts_at', $event->starts_at?->copy()->setTimezone($tz)->format('Y-m-d\TH:i'));
$endsValue = old('ends_at', $event->ends_at?->copy()->setTimezone($tz)->format('Y-m-d\TH:i'));
$chosen = collect(old('groups', $selectedGroups))->map(fn ($id) => (int) $id)->all();
@endphp
@section('title', ($isEdit ? __('admin.events.edit') : __('admin.events.create')) . ' — ' . __('admin.brand.name'))
@section('page_title', $isEdit ? __('admin.events.edit') : __('admin.events.create'))
@push('styles')
@endpush
@section('content')