Environment
-
Nextcloud: 32.0.5
-
App: Appointments (default)
-
OS: Ubuntu Server
-
Web server: Apache
-
PHP: 8.3.6
Background
I’m using the default Appointments app, which relies on fixed time slots.
I tried to improve it by replacing the slot selection with a custom time picker, where users select:
-
date
-
start time
-
duration
Then I map it internally to available slots.
What I’ve done
-
Modified form.php and added custom JS (custom-picker.js)
-
Replaced slot UI with time picker input
-
Converted selected time → matching slot
Slot selection works correctly
Time mapping is correct
Problem
When submitting the form:
-
Redirects to: form?sts=1
-
Booking is not saved
-
No clear error message
Suspected Cause
I suspect:
-
The request format does not match what Appointments expects
-
Missing required field (possibly slot identifier instead of raw time)
Code Snippet
Form modification (simplified):
<input type=“hidden” name=“adatetime” id=“srgdev-ncfp_sel-hidden”
data-state="<?= $\_\['appt_state'\] ?>"
data-info="<?= $\_\['appt_sel_opts'\] ?>">
JS (slot mapping):
function applySlot(hidden, index) {
hidden.selectedIndex = index;
hidden.value = hidden.dataRef\[index\].d;
hidden.dispatchEvent(new Event('change', { bubbles: true }));
}
hidden.value = ‘T’ + dayTs;
hidden.dispatchEvent(new Event(‘change’, { bubbles: true }));
Example slot data:
{
“rts”: …,
“dur”: […],
“d”: “…”
}
Expected
Form submits successfully and booking is created.
Actual
Redirect to form?sts=1 and booking fails.
Question
-
What fields are required for a valid booking request?
-
Does Appointments require a slot ID instead of raw time input?
-
Is there a proper way to override slot selection with a custom time picker?


