thunderbird / webext-experiments

WebExtension Experiments for Thunderbird
28 stars 12 forks source link

Drag-drop an event will make it use UTC time as local time #25

Closed leoleoasd closed 3 weeks ago

leoleoasd commented 1 year ago

While playing with this, I discovered that drag-dropping event will read the UTC time as local time. (Shiftted 8 hours earily in my environment). For example, if I drag an event and drop it at 10:00 AM, it will appear at 2:00 AM:

Provider modify in calendar 
Object { type: "event", id: "ba1fcd2f-fe1b-4286-83d5-734cc8658256", calendarId: "797e1e7c-3ebc-41d1-96ae-d58f3dcd8a34", title: "123", description: "", location: "", categories: [], metadata: {…}, formats: {…}, startDate: "20230525T020000", … }
calendarId: "797e1e7c-3ebc-41d1-96ae-d58f3dcd8a34"
categories: Array []
description: ""
endDate: "20230525T051500"
formats: Object { use: null, ical: "BEGIN:VCALENDAR\r\nPRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN\r\nVERSION:2.0\r\nBEGIN:VEVENT\r\nCREATED:20230528T112733Z\r\nLAST-MODIFIED:20230528T113047Z\r\nDTSTAMP:20230528T113047Z\r\nUID:ba1fcd2f-fe1b-4286-83d5-734cc8658256\r\nSUMMARY:123\r\nDTSTART:20230525T020000\r\nDTEND:20230525T051500\r\nTRANSP:OPAQUE\r\nSEQUENCE:8\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n" }
id: "ba1fcd2f-fe1b-4286-83d5-734cc8658256"
location: ""
metadata: Object { updated: true }
startDate: "20230525T020000"
title: "123"
type: "event"
<prototype>: Object { … }
Object { type: "event", id: "ba1fcd2f-fe1b-4286-83d5-734cc8658256", calendarId: "797e1e7c-3ebc-41d1-96ae-d58f3dcd8a34", title: "123", description: "", location: "", categories: [], metadata: {…}, formats: {…}, startDate: "20230525T114500", … }
calendarId: "797e1e7c-3ebc-41d1-96ae-d58f3dcd8a34"
categories: Array []
description: ""
endDate: "20230525T150000"
formats: Object { use: null, ical: "BEGIN:VCALENDAR\r\nPRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN\r\nVERSION:2.0\r\nBEGIN:VEVENT\r\nCREATED:20230528T112733Z\r\nLAST-MODIFIED:20230528T112849Z\r\nDTSTAMP:20230528T112849Z\r\nUID:ba1fcd2f-fe1b-4286-83d5-734cc8658256\r\nSUMMARY:123\r\nDTSTART:20230525T114500\r\nDTEND:20230525T150000\r\nTRANSP:OPAQUE\r\nSEQUENCE:7\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n" }
id: "ba1fcd2f-fe1b-4286-83d5-734cc8658256"
location: ""
metadata: Object { updated: true }
startDate: "20230525T114500"
title: "123"
type: "event"
<prototype>: Object { … }

dragging non-extension managed calendars works fine, and maually editing time works fine too. Thunderbird version: 102.11.2

kewisch commented 3 weeks ago

The simple properties API is being removed in favor of jcal in #34 . If you use jcal, your timezone calculations should be correct.