UTC zu User Timezone (vibe-kanban 8b00e084)

![image.png](.vibe-images/b2a398d1-1d7d-4428-8264-9ec47f9c8235_image.png)

In den Modals der Map Points auf der Karte müssen die Uhrzeiten von UTC in die User Zeitzone umgeschrieben werden.
This commit is contained in:
vk
2026-02-12 23:15:08 +01:00
parent fc42d2d2e2
commit 41d8b6268b
4 changed files with 96 additions and 2 deletions

View File

@@ -15,6 +15,8 @@ PHP_CLI_SERVER_WORKERS=4
BCRYPT_ROUNDS=12
CIPHERSWEET_KEY=
LOG_CHANNEL=stack
LOG_STACK=single
LOG_DEPRECATIONS_CHANNEL=null

View File

@@ -0,0 +1,31 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('sessions', function (Blueprint $table) {
$table->string('id')->primary();
$table->foreignId('user_id')->nullable()->index();
$table->string('ip_address', 45)->nullable();
$table->text('user_agent')->nullable();
$table->longText('payload');
$table->integer('last_activity')->index();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('sessions');
}
};

View File

@@ -17,12 +17,12 @@
<div class="space-y-1">
<flux:text class="text-sm flex items-center gap-2">
<flux:icon.calendar class="w-4 h-4"/>
{{ $meetup->nextEvent['start']->format('d.m.Y') }}
{{ $meetup->nextEvent['start']->asDate() }}
</flux:text>
<flux:text class="text-sm flex items-center gap-2">
<flux:icon.clock class="w-4 h-4"/>
{{ $meetup->nextEvent['start']->format('H:i') }} Uhr
{{ $meetup->nextEvent['start']->asTime() }} Uhr
</flux:text>
@if($meetup->nextEvent['location'])

View File

@@ -0,0 +1,61 @@
<?php
use App\Models\City;
use App\Models\Country;
use App\Models\Meetup;
use App\Models\MeetupEvent;
it('displays event time converted to user timezone in meetup popup', function () {
config(['app.user-timezone' => 'Europe/Berlin']);
$country = Country::factory()->create();
$city = City::factory()->create(['country_id' => $country->id]);
$meetup = Meetup::factory()->create(['city_id' => $city->id, 'intro' => 'Test intro']);
MeetupEvent::factory()->create([
'meetup_id' => $meetup->id,
'start' => '2026-02-19 16:30:00', // UTC
'location' => 'Test Location',
]);
$meetup->load(['meetupEvents' => function ($query) {
$query->where('start', '>=', now())->orderBy('start')->limit(1);
}]);
$html = view('components.meetup-popup', [
'meetup' => $meetup,
'url' => 'https://example.com',
'eventUrl' => 'https://example.com/event',
])->render();
// 16:30 UTC = 17:30 CET (Europe/Berlin in winter)
expect($html)->toContain('17:30 Uhr')
->and($html)->not->toContain('16:30 Uhr');
});
it('displays event date converted to user timezone in meetup popup', function () {
config(['app.user-timezone' => 'Europe/Berlin']);
$country = Country::factory()->create();
$city = City::factory()->create(['country_id' => $country->id]);
$meetup = Meetup::factory()->create(['city_id' => $city->id]);
MeetupEvent::factory()->create([
'meetup_id' => $meetup->id,
'start' => '2026-02-19 23:30:00', // UTC - next day in Berlin
'location' => 'Test Location',
]);
$meetup->load(['meetupEvents' => function ($query) {
$query->where('start', '>=', now())->orderBy('start')->limit(1);
}]);
$html = view('components.meetup-popup', [
'meetup' => $meetup,
'url' => 'https://example.com',
'eventUrl' => null,
])->render();
// 23:30 UTC on Feb 19 = 00:30 CET on Feb 20 in Europe/Berlin
expect($html)->toContain('20. Februar 2026');
});