feat(workspace): use selects for quick event date/time controls
This commit is contained in:
@@ -896,6 +896,31 @@ function closeCommQuickMenu() {
|
||||
commQuickMenuOpen.value = false;
|
||||
}
|
||||
|
||||
const commEventDateOptions = computed(() => {
|
||||
const out: string[] = [];
|
||||
const today = new Date();
|
||||
for (let i = -7; i <= 30; i += 1) {
|
||||
const d = new Date(today);
|
||||
d.setDate(today.getDate() + i);
|
||||
out.push(dayKey(d));
|
||||
}
|
||||
const selected = String(commEventForm.value.startDate ?? "").trim();
|
||||
if (selected && !out.includes(selected)) out.unshift(selected);
|
||||
return out;
|
||||
});
|
||||
|
||||
const commEventTimeOptions = computed(() => {
|
||||
const out: string[] = [];
|
||||
for (let hour = 0; hour < 24; hour += 1) {
|
||||
for (let minute = 0; minute < 60; minute += 15) {
|
||||
out.push(`${String(hour).padStart(2, "0")}:${String(minute).padStart(2, "0")}`);
|
||||
}
|
||||
}
|
||||
const selected = String(commEventForm.value.startTime ?? "").trim();
|
||||
if (selected && !out.includes(selected)) out.unshift(selected);
|
||||
return out;
|
||||
});
|
||||
|
||||
function commComposerPlaceholder() {
|
||||
if (commComposerMode.value === "planned") return "Опиши, что нужно запланировать...";
|
||||
if (commComposerMode.value === "logged") return "Опиши итог/отчёт по прошедшему событию...";
|
||||
@@ -2110,18 +2135,32 @@ onBeforeUnmount(() => {
|
||||
/>
|
||||
|
||||
<div v-if="commComposerMode === 'planned' || commComposerMode === 'logged'" class="comm-event-controls">
|
||||
<input
|
||||
<select
|
||||
v-model="commEventForm.startDate"
|
||||
type="date"
|
||||
class="input input-bordered input-xs h-7 min-h-7"
|
||||
class="select select-bordered select-xs h-7 min-h-7"
|
||||
:disabled="commEventSaving"
|
||||
>
|
||||
<input
|
||||
<option
|
||||
v-for="dateValue in commEventDateOptions"
|
||||
:key="`comm-event-date-${dateValue}`"
|
||||
:value="dateValue"
|
||||
>
|
||||
{{ formatDay(`${dateValue}T00:00:00`) }}
|
||||
</option>
|
||||
</select>
|
||||
<select
|
||||
v-model="commEventForm.startTime"
|
||||
type="time"
|
||||
class="input input-bordered input-xs h-7 min-h-7"
|
||||
class="select select-bordered select-xs h-7 min-h-7"
|
||||
:disabled="commEventSaving"
|
||||
>
|
||||
<option
|
||||
v-for="timeValue in commEventTimeOptions"
|
||||
:key="`comm-event-time-${timeValue}`"
|
||||
:value="timeValue"
|
||||
>
|
||||
{{ timeValue }}
|
||||
</option>
|
||||
</select>
|
||||
<select
|
||||
v-model.number="commEventForm.durationMinutes"
|
||||
class="select select-bordered select-xs h-7 min-h-7"
|
||||
|
||||
Reference in New Issue
Block a user