Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion app/Http/Controllers/App/PostController.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@ public function calendar(Request $request): Response|RedirectResponse

$this->authorize('view', $workspace);

$tz = 'UTC';
// Дни календаря считаются в таймзоне воркспейса: пост на 23:00 по
// Брисбену должен лежать в брисбенском дне, а не в UTC-шном. Без
// настройки — прежнее поведение (UTC).
$tz = $workspace->timezone ?: 'UTC';
$view = $request->input('view', 'week');

$currentDay = $request->input('day')
Expand Down
2 changes: 2 additions & 0 deletions app/Http/Requests/App/Workspace/UpdateWorkspaceRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ public function rules(): array
'image_style' => ['sometimes', 'required', 'string', Rule::in(ImageStyle::values())],
'content_language' => ['sometimes', 'string', Rule::in(ContentLanguage::values())],
'logo_url' => ['nullable', 'url', 'max:1024'],
'timezone' => ['sometimes', 'nullable', 'string', 'timezone:all'],
'datetime_format' => ['sometimes', 'nullable', 'string', Rule::in(['dmy_24', 'dmy_12', 'dots_24', 'slash_12'])],
];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ public static function make(Workspace $workspace, ?User $user = null): array
'id' => $workspace->id,
'name' => $workspace->name,
'logo_url' => $workspace->logo_url,
'timezone' => $workspace->timezone,
'datetime_format' => $workspace->datetime_format,
'created_at' => $workspace->created_at->toIso8601String(),
'role' => $user ? self::resolveRole($workspace, $user) : null,
];
Expand Down
2 changes: 2 additions & 0 deletions app/Models/Workspace.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class Workspace extends Model
'brand_font',
'image_style',
'content_language',
'timezone',
'datetime_format',
];

protected function casts(): array
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

declare(strict_types=1);

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
public function up(): void
{
Schema::table('workspaces', function (Blueprint $table) {
// IANA identifier (e.g. "Australia/Brisbane"). Null = the viewer's
// browser timezone, the pre-setting behavior.
$table->string('timezone', 64)->nullable()->after('content_language');
});
}

public function down(): void
{
Schema::table('workspaces', function (Blueprint $table) {
$table->dropColumn('timezone');
});
}
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

declare(strict_types=1);

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
public function up(): void
{
Schema::table('workspaces', function (Blueprint $table) {
// Пресет отображения даты/времени (см. UpdateWorkspaceRequest).
// Null = «авто»: локализованный формат dayjs, прежнее поведение.
$table->string('datetime_format', 20)->nullable()->after('timezone');
});
}

public function down(): void
{
Schema::table('workspaces', function (Blueprint $table) {
$table->dropColumn('datetime_format');
});
}
};
6 changes: 6 additions & 0 deletions lang/ar/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@
'members_description' => 'إدارة أعضاء مساحة العمل والدعوات',
'name' => 'الاسم',
'name_placeholder' => 'مساحة عملي',
'timezone' => 'المنطقة الزمنية',
'timezone_auto' => 'تلقائي — منطقة المتصفح (:tz)',
'timezone_description' => 'يُعرض التقويم والجدولة وتواريخ المنشورات بهذه المنطقة الزمنية لجميع أعضاء مساحة العمل.',
'datetime_format' => 'تنسيق التاريخ والوقت',
'datetime_format_auto' => 'تلقائي — حسب اللغة',
'datetime_format_description' => 'يُطبَّق على التقويم وجميع قوائم المنشورات.',
'save' => 'حفظ',
'danger_description' => 'إجراءات لا يمكن التراجع عنها.',
'delete_warning' => 'تحذير',
Expand Down
6 changes: 6 additions & 0 deletions lang/de/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@
'members_description' => 'Verwalte die Mitglieder und Einladungen des Workspace',
'name' => 'Name',
'name_placeholder' => 'Mein Workspace',
'timezone' => 'Zeitzone',
'timezone_auto' => 'Auto — Browser-Zeitzone (:tz)',
'timezone_description' => 'Kalender, Zeitplan und Beitragsdaten werden für alle im Workspace in dieser Zeitzone angezeigt.',
'datetime_format' => 'Datums- & Zeitformat',
'datetime_format_auto' => 'Auto — Sprachstandard',
'datetime_format_description' => 'Gilt für den Kalender und alle Beitragslisten.',
'save' => 'Speichern',
'danger_description' => 'Unwiderrufliche Aktionen.',
'delete_warning' => 'Warnung',
Expand Down
6 changes: 6 additions & 0 deletions lang/el/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@
'members_description' => 'Διαχειριστείτε τα μέλη και τις προσκλήσεις του workspace',
'name' => 'Όνομα',
'name_placeholder' => 'Το workspace μου',
'timezone' => 'Ζώνη ώρας',
'timezone_auto' => 'Αυτόματα — ζώνη του προγράμματος περιήγησης (:tz)',
'timezone_description' => 'Το ημερολόγιο, ο προγραμματισμός και οι ημερομηνίες αναρτήσεων εμφανίζονται σε αυτήν τη ζώνη για όλο το workspace.',
'datetime_format' => 'Μορφή ημερομηνίας και ώρας',
'datetime_format_auto' => 'Αυτόματα — προεπιλογή γλώσσας',
'datetime_format_description' => 'Εφαρμόζεται στο ημερολόγιο και σε όλες τις λίστες αναρτήσεων.',
'save' => 'Αποθήκευση',
'danger_description' => 'Μη αναστρέψιμες ενέργειες.',
'delete_warning' => 'Προειδοποίηση',
Expand Down
6 changes: 6 additions & 0 deletions lang/en/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@
'members_description' => 'Manage workspace members and invitations',
'name' => 'Name',
'name_placeholder' => 'My Workspace',
'timezone' => 'Timezone',
'timezone_auto' => 'Auto — browser timezone (:tz)',
'timezone_description' => 'Calendar, schedule and post dates are shown in this timezone for everyone in the workspace.',
'datetime_format' => 'Date & time format',
'datetime_format_auto' => 'Auto — language default',
'datetime_format_description' => 'Applied to the calendar and all post lists.',
'save' => 'Save',
'danger_description' => 'Irreversible actions.',
'delete_warning' => 'Warning',
Expand Down
6 changes: 6 additions & 0 deletions lang/es/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@
'members_description' => 'Administra miembros e invitaciones del workspace',
'name' => 'Nombre',
'name_placeholder' => 'Mi Workspace',
'timezone' => 'Zona horaria',
'timezone_auto' => 'Auto — zona del navegador (:tz)',
'timezone_description' => 'El calendario, la programación y las fechas de publicaciones se muestran en esta zona para todo el workspace.',
'datetime_format' => 'Formato de fecha y hora',
'datetime_format_auto' => 'Auto — según el idioma',
'datetime_format_description' => 'Se aplica al calendario y a todas las listas de publicaciones.',
'save' => 'Guardar',
'danger_description' => 'Acciones irreversibles.',
'delete_warning' => 'Advertencia',
Expand Down
6 changes: 6 additions & 0 deletions lang/fr/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@
'members_description' => 'Gérez les membres et les invitations de l\'espace de travail',
'name' => 'Nom',
'name_placeholder' => 'Mon espace de travail',
'timezone' => 'Fuseau horaire',
'timezone_auto' => 'Auto — fuseau du navigateur (:tz)',
'timezone_description' => 'Le calendrier, la planification et les dates des publications s’affichent dans ce fuseau pour tout le workspace.',
'datetime_format' => 'Format de date et d’heure',
'datetime_format_auto' => 'Auto — selon la langue',
'datetime_format_description' => 'Appliqué au calendrier et à toutes les listes de publications.',
'save' => 'Enregistrer',
'danger_description' => 'Actions irréversibles.',
'delete_warning' => 'Avertissement',
Expand Down
6 changes: 6 additions & 0 deletions lang/it/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@
'members_description' => 'Gestisci i membri e gli inviti del workspace',
'name' => 'Nome',
'name_placeholder' => 'Il mio workspace',
'timezone' => 'Fuso orario',
'timezone_auto' => 'Auto — fuso del browser (:tz)',
'timezone_description' => 'Calendario, programmazione e date dei post vengono mostrati in questo fuso per tutto il workspace.',
'datetime_format' => 'Formato data e ora',
'datetime_format_auto' => 'Auto — in base alla lingua',
'datetime_format_description' => 'Applicato al calendario e a tutti gli elenchi di post.',
'save' => 'Salva',
'danger_description' => 'Azioni irreversibili.',
'delete_warning' => 'Attenzione',
Expand Down
6 changes: 6 additions & 0 deletions lang/ja/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@
'members_description' => 'ワークスペースのメンバーと招待を管理します',
'name' => '名前',
'name_placeholder' => 'マイワークスペース',
'timezone' => 'タイムゾーン',
'timezone_auto' => '自動 — ブラウザのタイムゾーン (:tz)',
'timezone_description' => 'カレンダー、スケジュール、投稿日時はワークスペース全員にこのタイムゾーンで表示されます。',
'datetime_format' => '日付と時刻の形式',
'datetime_format_auto' => '自動 — 言語の既定',
'datetime_format_description' => 'カレンダーとすべての投稿リストに適用されます。',
'save' => '保存',
'danger_description' => '元に戻せない操作です。',
'delete_warning' => '警告',
Expand Down
6 changes: 6 additions & 0 deletions lang/ko/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@
'members_description' => '워크스페이스 멤버와 초대를 관리하세요',
'name' => '이름',
'name_placeholder' => '내 워크스페이스',
'timezone' => '시간대',
'timezone_auto' => '자동 — 브라우저 시간대 (:tz)',
'timezone_description' => '캘린더, 일정, 게시물 날짜가 워크스페이스 전체에 이 시간대로 표시됩니다.',
'datetime_format' => '날짜 및 시간 형식',
'datetime_format_auto' => '자동 — 언어 기본값',
'datetime_format_description' => '캘린더와 모든 게시물 목록에 적용됩니다.',
'save' => '저장',
'danger_description' => '되돌릴 수 없는 작업입니다.',
'delete_warning' => '경고',
Expand Down
6 changes: 6 additions & 0 deletions lang/nl/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@
'members_description' => 'Beheer workspaceleden en uitnodigingen',
'name' => 'Naam',
'name_placeholder' => 'Mijn workspace',
'timezone' => 'Tijdzone',
'timezone_auto' => 'Auto — browsertijdzone (:tz)',
'timezone_description' => 'Kalender, planning en berichtdatums worden voor iedereen in de workspace in deze tijdzone getoond.',
'datetime_format' => 'Datum- en tijdnotatie',
'datetime_format_auto' => 'Auto — taalstandaard',
'datetime_format_description' => 'Toegepast op de kalender en alle berichtlijsten.',
'save' => 'Opslaan',
'danger_description' => 'Onomkeerbare acties.',
'delete_warning' => 'Waarschuwing',
Expand Down
6 changes: 6 additions & 0 deletions lang/pl/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@
'members_description' => 'Zarządzaj członkami i zaproszeniami przestrzeni roboczej',
'name' => 'Nazwa',
'name_placeholder' => 'Moja przestrzeń robocza',
'timezone' => 'Strefa czasowa',
'timezone_auto' => 'Auto — strefa przeglądarki (:tz)',
'timezone_description' => 'Kalendarz, harmonogram i daty postów są pokazywane w tej strefie wszystkim w workspace.',
'datetime_format' => 'Format daty i godziny',
'datetime_format_auto' => 'Auto — wg języka',
'datetime_format_description' => 'Stosowany do kalendarza i wszystkich list postów.',
'save' => 'Zapisz',
'danger_description' => 'Nieodwracalne działania.',
'delete_warning' => 'Ostrzeżenie',
Expand Down
6 changes: 6 additions & 0 deletions lang/pt-BR/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@
'members_description' => 'Gerencie membros e convites do workspace',
'name' => 'Nome',
'name_placeholder' => 'Meu Workspace',
'timezone' => 'Fuso horário',
'timezone_auto' => 'Auto — fuso do navegador (:tz)',
'timezone_description' => 'Calendário, agendamento e datas das publicações são exibidos neste fuso para todo o workspace.',
'datetime_format' => 'Formato de data e hora',
'datetime_format_auto' => 'Auto — padrão do idioma',
'datetime_format_description' => 'Aplicado ao calendário e a todas as listas de publicações.',
'save' => 'Salvar',
'danger_description' => 'Ações irreversíveis.',
'delete_warning' => 'Atenção',
Expand Down
6 changes: 6 additions & 0 deletions lang/ru/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@
'members_description' => 'Управляйте участниками и приглашениями рабочего пространства',
'name' => 'Название',
'name_placeholder' => 'Моё рабочее пространство',
'timezone' => 'Часовой пояс',
'timezone_auto' => 'Авто — часовой пояс браузера (:tz)',
'timezone_description' => 'Календарь, расписание и даты постов показываются в этом поясе всем участникам воркспейса.',
'datetime_format' => 'Формат даты и времени',
'datetime_format_auto' => 'Авто — по языку интерфейса',
'datetime_format_description' => 'Применяется к календарю и всем спискам постов.',
'save' => 'Сохранить',
'danger_description' => 'Необратимые действия.',
'delete_warning' => 'Внимание',
Expand Down
6 changes: 6 additions & 0 deletions lang/tr/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@
'members_description' => 'Çalışma alanı üyelerini ve davetlerini yönetin',
'name' => 'Ad',
'name_placeholder' => 'Çalışma Alanım',
'timezone' => 'Saat dilimi',
'timezone_auto' => 'Otomatik — tarayıcı saat dilimi (:tz)',
'timezone_description' => 'Takvim, plan ve gönderi tarihleri çalışma alanındaki herkese bu dilimde gösterilir.',
'datetime_format' => 'Tarih ve saat biçimi',
'datetime_format_auto' => 'Otomatik — dil varsayılanı',
'datetime_format_description' => 'Takvime ve tüm gönderi listelerine uygulanır.',
'save' => 'Kaydet',
'danger_description' => 'Geri alınamaz işlemler.',
'delete_warning' => 'Uyarı',
Expand Down
6 changes: 6 additions & 0 deletions lang/uk/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@
'members_description' => 'Керуйте учасниками та запрошеннями робочого простору',
'name' => 'Назва',
'name_placeholder' => 'Мій робочий простір',
'timezone' => 'Часовий пояс',
'timezone_auto' => 'Авто — часовий пояс браузера (:tz)',
'timezone_description' => 'Календар, розклад і дати постів показуються в цьому поясі всім учасникам воркспейсу.',
'datetime_format' => 'Формат дати й часу',
'datetime_format_auto' => 'Авто — за мовою інтерфейсу',
'datetime_format_description' => 'Застосовується до календаря та всіх списків постів.',
'save' => 'Зберегти',
'danger_description' => 'Незворотні дії.',
'delete_warning' => 'Увага',
Expand Down
6 changes: 6 additions & 0 deletions lang/zh/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@
'members_description' => '管理工作区成员和邀请',
'name' => '名称',
'name_placeholder' => '我的工作区',
'timezone' => '时区',
'timezone_auto' => '自动 — 浏览器时区 (:tz)',
'timezone_description' => '日历、排期和帖子日期将以此时区向工作区所有成员显示。',
'datetime_format' => '日期和时间格式',
'datetime_format_auto' => '自动 — 随界面语言',
'datetime_format_description' => '应用于日历和所有帖子列表。',
'save' => '保存',
'danger_description' => '不可撤销的操作。',
'delete_warning' => '警告',
Expand Down
47 changes: 47 additions & 0 deletions resources/js/components/settings/WorkspaceTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ interface Workspace {
name: string;
has_logo: boolean;
logo_url: string | null;
timezone?: string | null;
datetime_format?: string | null;
}

defineProps<{
Expand All @@ -27,6 +29,23 @@ defineProps<{
}>();

const { canManageBilling } = useWorkspaceRole();

const browserTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone;

const timezones: string[] = (() => {
try {
return (Intl as any).supportedValuesOf('timeZone') as string[];
} catch {
return [browserTimezone];
}
})();

const formatPresets = [
{ value: 'dmy_24', example: '20 Aug 2026, 18:30' },
{ value: 'dmy_12', example: '20 Aug 2026, 6:30 PM' },
{ value: 'dots_24', example: '20.08.2026 18:30' },
{ value: 'slash_12', example: '08/20/2026 6:30 PM' },
];
</script>

<template>
Expand Down Expand Up @@ -70,6 +89,34 @@ const { canManageBilling } = useWorkspaceRole();
<InputError :message="errors.name" />
</div>

<div class="grid gap-2">
<Label for="timezone">{{ $t('settings.workspace.timezone') }}</Label>
<select
id="timezone"
name="timezone"
class="border-input h-9 w-full rounded-md border-2 bg-transparent px-3 py-1 text-sm shadow-2xs"
>
<option value="" :selected="!workspace.timezone">{{ $t('settings.workspace.timezone_auto', { tz: browserTimezone }) }}</option>
<option v-for="tz in timezones" :key="tz" :value="tz" :selected="workspace.timezone === tz">{{ tz }}</option>
</select>
<p class="text-xs text-foreground/60">{{ $t('settings.workspace.timezone_description') }}</p>
<InputError :message="errors.timezone" />
</div>

<div class="grid gap-2">
<Label for="datetime_format">{{ $t('settings.workspace.datetime_format') }}</Label>
<select
id="datetime_format"
name="datetime_format"
class="border-input h-9 w-full rounded-md border-2 bg-transparent px-3 py-1 text-sm shadow-2xs"
>
<option value="" :selected="!workspace.datetime_format">{{ $t('settings.workspace.datetime_format_auto') }}</option>
<option v-for="preset in formatPresets" :key="preset.value" :value="preset.value" :selected="workspace.datetime_format === preset.value">{{ preset.example }}</option>
</select>
<p class="text-xs text-foreground/60">{{ $t('settings.workspace.datetime_format_description') }}</p>
<InputError :message="errors.datetime_format" />
</div>

<Button :disabled="processing">{{ $t('settings.workspace.save') }}</Button>
</Form>
</div>
Expand Down
Loading