Fix: CalDAV delete/update, Copy-Menü-Reset, Timezone beim Kopieren
- caldav_client: client.event() → caldav.Event() mit resource.load() für update/delete (DAVClient hat keine event()-Methode) - Popup: Copy-Menü wird beim Öffnen eines neuen Events immer zurückgesetzt - copyEventToCalendar: start/end via new Date().toISOString() normalisiert → verhindert 2h-Verschiebung bei Terminen ohne Timezone-Info
This commit is contained in:
@@ -211,7 +211,8 @@ def update_event(
|
|||||||
url: str, username: str, password: str, event_url: str, data: Dict
|
url: str, username: str, password: str, event_url: str, data: Dict
|
||||||
):
|
):
|
||||||
client = _client(url, username, password)
|
client = _client(url, username, password)
|
||||||
resource = client.event(url=event_url)
|
resource = caldav.Event(client=client, url=event_url)
|
||||||
|
resource.load()
|
||||||
raw = resource.data
|
raw = resource.data
|
||||||
|
|
||||||
cal = Calendar.from_ical(raw)
|
cal = Calendar.from_ical(raw)
|
||||||
@@ -255,7 +256,7 @@ def update_event(
|
|||||||
|
|
||||||
def delete_event(url: str, username: str, password: str, event_url: str):
|
def delete_event(url: str, username: str, password: str, event_url: str):
|
||||||
client = _client(url, username, password)
|
client = _client(url, username, password)
|
||||||
resource = client.event(url=event_url)
|
resource = caldav.Event(client=client, url=event_url)
|
||||||
resource.delete()
|
resource.delete()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -723,6 +723,7 @@ function bindSidebar() {
|
|||||||
// ── Event Popup ───────────────────────────────────────────
|
// ── Event Popup ───────────────────────────────────────────
|
||||||
function showEventPopup(ev, anchor) {
|
function showEventPopup(ev, anchor) {
|
||||||
const popup = document.getElementById('popup-event');
|
const popup = document.getElementById('popup-event');
|
||||||
|
document.getElementById('popup-copy-menu').classList.add('hidden');
|
||||||
popup.classList.remove('hidden');
|
popup.classList.remove('hidden');
|
||||||
|
|
||||||
const color = ev.color || ev.calendarColor || '#4285f4';
|
const color = ev.color || ev.calendarColor || '#4285f4';
|
||||||
@@ -1935,7 +1936,11 @@ function buildWritableCalendars(_excludeEv) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function copyEventToCalendar(ev, cal) {
|
async function copyEventToCalendar(ev, cal) {
|
||||||
const { title, start, end, allDay, location, description, color } = ev;
|
const { title, allDay, location, description, color } = ev;
|
||||||
|
// Normalize to UTC ISO string so the backend doesn't misinterpret bare local times
|
||||||
|
const toISO = s => (s && s.length > 10) ? new Date(s).toISOString() : s;
|
||||||
|
const start = allDay ? ev.start : toISO(ev.start);
|
||||||
|
const end = allDay ? ev.end : toISO(ev.end);
|
||||||
try {
|
try {
|
||||||
if (cal.type === 'google') {
|
if (cal.type === 'google') {
|
||||||
await api.post('/google/events', {
|
await api.post('/google/events', {
|
||||||
|
|||||||
Reference in New Issue
Block a user