- set default length of a meeting to 30 minutes
- round to the next quarter
This commit is contained in:
1 parent
77367e86a1
commit
f86e29ac9a
1 file changed
+55
-8
+55
-8
@@ -460,12 +460,12 @@
|
|||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="meetingStart" data-i18n="creator.meetingStartLabel">Start Date & Time</label>
|
<label for="meetingStart" data-i18n="creator.meetingStartLabel">Start Date & Time</label>
|
||||||
<input type="datetime-local" id="meetingStart" />
|
<input type="datetime-local" id="meetingStart" step="900" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="meetingEnd" data-i18n="creator.meetingEndLabel">End Date & Time</label>
|
<label for="meetingEnd" data-i18n="creator.meetingEndLabel">End Date & Time</label>
|
||||||
<input type="datetime-local" id="meetingEnd" />
|
<input type="datetime-local" id="meetingEnd" step="900" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
@@ -1422,6 +1422,51 @@ END:VCALENDAR`;
|
|||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const MINUTES_STEP = 15;
|
||||||
|
const DEFAULT_DURATION_MINUTES = 30;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Minuten auf das 15-Minuten-Raster aufrunden.
|
||||||
|
*
|
||||||
|
* Beispiel:
|
||||||
|
*
|
||||||
|
* 14:07 ergibt 14:15
|
||||||
|
* 14:50 ergibt 15:00
|
||||||
|
*/
|
||||||
|
function roundMinutes(date) {
|
||||||
|
const rounded = new Date(date);
|
||||||
|
|
||||||
|
rounded.setSeconds(0, 0);
|
||||||
|
rounded.setMinutes(
|
||||||
|
Math.ceil(date.getMinutes() / MINUTES_STEP) * MINUTES_STEP
|
||||||
|
);
|
||||||
|
|
||||||
|
return rounded;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Lokale Zeit für datetime-local formatieren.
|
||||||
|
*
|
||||||
|
* Beispiel:
|
||||||
|
*
|
||||||
|
* 1. Januar 2026, 14:15 ergibt "2026-01-01T14:15"
|
||||||
|
*/
|
||||||
|
function formatLocal(date) {
|
||||||
|
const pad = (num) => num.toString().padStart(2, "0");
|
||||||
|
|
||||||
|
return (
|
||||||
|
date.getFullYear() +
|
||||||
|
"-" +
|
||||||
|
pad(date.getMonth() + 1) +
|
||||||
|
"-" +
|
||||||
|
pad(date.getDate()) +
|
||||||
|
"T" +
|
||||||
|
pad(date.getHours()) +
|
||||||
|
":" +
|
||||||
|
pad(date.getMinutes())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
function showMeetingCreator() {
|
function showMeetingCreator() {
|
||||||
/* Hide all other views */
|
/* Hide all other views */
|
||||||
launcher.classList.add("hidden");
|
launcher.classList.add("hidden");
|
||||||
@@ -1441,11 +1486,13 @@ END:VCALENDAR`;
|
|||||||
icsSuccess.classList.add("hidden");
|
icsSuccess.classList.add("hidden");
|
||||||
|
|
||||||
/* Set default start and end times */
|
/* Set default start and end times */
|
||||||
const now = new Date();
|
const start = roundMinutes(new Date());
|
||||||
const inOneHour = new Date(now.getTime() + 60 * 60 * 1000);
|
const end = new Date(
|
||||||
|
start.getTime() + DEFAULT_DURATION_MINUTES * 60 * 1000
|
||||||
meetingStartInput.value = now.toISOString().slice(0, 16);
|
);
|
||||||
meetingEndInput.value = inOneHour.toISOString().slice(0, 16);
|
|
||||||
|
meetingStartInput.value = formatLocal(start);
|
||||||
|
meetingEndInput.value = formatLocal(end);
|
||||||
}
|
}
|
||||||
|
|
||||||
function createMeeting() {
|
function createMeeting() {
|
||||||
|
|||||||
Reference in new issue
Block a user