Export a calendar as an iCAL file
The mirror of the import from #173, and the last thing contacts had that calendars did not -- an address book could always be exported, a calendar never could. It is written here rather than asked for. The import hands parsing to the server because Stalwart has a CalendarEvent/parse and reimplementing an .ics reader in a browser would be foolish; there is no method the other way, in Stalwart or in the JMAP calendar drafts, so the file is built from the RFC 8984 objects the server already returns. Most of that is renaming: 8984 was written as a restatement of 5545, and the comments say which way it went wherever the two disagree. The masters, not the occurrences. The query runs without expandRecurrences, so a weekly meeting leaves as one VEVENT carrying its RRULE rather than as a year of identical ones -- an export that had flattened the rule would import somewhere else as a pile nobody can maintain. A changed occurrence goes out as its own VEVENT with the same UID and a RECURRENCE-ID, which is how iCalendar has always said it; a cancelled one becomes an EXDATE. Three decisions worth stating rather than leaving to be found: No VTIMEZONE components. A TZID names the IANA zone the server holds and nothing defines it beside it, because defining it means shipping a zone database to describe rules the reader's own system already knows. Every client that matters resolves IANA names. The alternative -- converting to UTC -- would be worse than a validator's complaint: a weekly 09:00 that becomes 08:00 for half the year is a wrong calendar. UNTIL follows DTSTART's kind, a date for an all-day series and a UTC instant otherwise. Sending a local time there is the usual way to make a series stop a day early in another timezone. Overrides are applied at the top level only. A recurrence override is a JSON patch, and one addressing locations/x/name is not something this flattens. Closes #216.
This commit is contained in:
@@ -52,6 +52,8 @@ import type { Catalog } from "@/lib/i18n";
|
||||
*/
|
||||
export const catalog: Catalog = {
|
||||
strings: {
|
||||
"Export iCAL file": "Exporter un fichier iCAL",
|
||||
"Could not export this calendar: {error}": "Impossible d’exporter ce calendrier : {error}",
|
||||
// ── Actions ────────────────────────────────────────────────────────
|
||||
"Archive": "Archiver",
|
||||
"Archive (e)": "Archiver (e)",
|
||||
@@ -1054,6 +1056,7 @@ export const catalog: Catalog = {
|
||||
"Nothing unread here": "Rien de non lu ici",
|
||||
},
|
||||
plurals: {
|
||||
"Exported {n} events": { one: "{n} événement exporté", other: "{n} événements exportés" },
|
||||
"Imported {n} events": { one: "{n} événement importé", other: "{n} événements importés" },
|
||||
"Already here: {n} events, nothing imported": { one: "Déjà présent : {n} événement, rien d’importé", other: "Déjà présents : {n} événements, rien d’importé" },
|
||||
"{n} were already here": { one: "{n} était déjà présent", other: "{n} étaient déjà présents" },
|
||||
|
||||
Reference in New Issue
Block a user