mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-app.git
synced 2026-03-14 02:13:17 +00:00
UTC zu User Timezone (vibe-kanban 8b00e084)
 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:
@@ -15,6 +15,8 @@ PHP_CLI_SERVER_WORKERS=4
|
||||
|
||||
BCRYPT_ROUNDS=12
|
||||
|
||||
CIPHERSWEET_KEY=
|
||||
|
||||
LOG_CHANNEL=stack
|
||||
LOG_STACK=single
|
||||
LOG_DEPRECATIONS_CHANNEL=null
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
};
|
||||
@@ -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'])
|
||||
|
||||
61
tests/Feature/MeetupPopupTimezoneTest.php
Normal file
61
tests/Feature/MeetupPopupTimezoneTest.php
Normal 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');
|
||||
});
|
||||
Reference in New Issue
Block a user