Trending

World technology news

→
Primary venues and additional locations in iCalendar with RFC 9073
Software Engineering · 2021
Software Engineering2021

Primary venues and additional locations in iCalendar with RFC 9073

Explore the 2021 iCalendar extension through a locally executed example that stores a main workshop and its east entrance in one event.

Archive retrospective · Topic year 2021

Developer's JournalPublished: Dec 6, 20266 min read
Reading progress0%
In this article
  1. A venue name and a distinct place record
  2. A basic event and richer location components
  3. Check what older clients can display
  4. Four checks in a reproducible fixture
  5. Preserve source data as the calendar grows
  6. Test the effect of revising one place

A venue name and a distinct place record

A public workshop calendar serves people checking the general location and people already approaching the building who need an entrance. In a simple announcement a single text box can serve both purposes. Once several applications consume the event, consistently recovering the venue name and entrance from one string becomes harder. RFC 9073, published in August 2021, adds event publishing features to iCalendar. A VLOCATION component can describe a venue or a location associated with the event. In this example the reader can see a primary venue as basic text, and an expanded view can also show two distinct location records. Both records belong to one VEVENT. They preserve the event's identity and schedule and avoid representing an entrance as an additional event.

A basic event and richer location components

The base iCalendar format in RFC 5545 uses VEVENT to represent the event, and UID to identify it consistently. In the fixture DTSTART is the start, DTEND is the end and DTSTAMP is the record timestamp, expressed in UTC. SUMMARY names the workshop. The plain LOCATION value is Main workshop. RFC 9073 adds repeatable VLOCATION components. Each component has a UID of its own. Their NAME values identify the main workshop and the east entrance. The same fixture is used in both languages, so the result can be reproduced directly. In a real publisher it is useful to keep a location identity separate from the name shown to a visitor. An editorial name change or a translated label can then preserve the place identity across calendar exports.

Application flowConceptual sketch · summary of the article's technical flow
Illustrative diagram. One calendar event containing a base location and two VLOCATION components.

Check what older clients can display

A shared calendar can go to an operating system calendar, a meeting manager and a website at the same time. Verify how each application treats the richer location components. A meaningful plain LOCATION gives a basic view the venue name. If the entrance is essential for access, publishing short directions in the ordinary description also helps readers who use that view. Component order in this example carries no interoperability promise about which place an application should mark as primary. The publisher knows the intended main venue in its own source data and uses that choice to set the plain location. An expanded view can add the entrance as a second item. A basic and an expanded client are a useful pair to compare before changing a live event feed.

Four checks in a reproducible fixture

The code joins sample calendar records with CRLF endings. A small reader finds the base location. It collects one UID and one NAME between the boundaries of each VLOCATION component. The first check expects Main workshop as the base location. Two further assertions check the names of the two places and the number of distinct component identities. The last assertion looks for the expected UTC end line. The code ran on Windows with Node.js 24.19.0 and passed all four checks. The example lines are short and do not require folding. The accompanying reader covers just these carefully selected records. For a general iCalendar file, use a conforming implementation and test its handling of parameters, escaping, folded lines, and the range of components that the application supports. Rendering, storage, and re-export need separate checks. A client can keep a place component without showing it, or show it after import and drop it from the next export. Comparing a rendered screen alone misses these differences.

import assert from 'node:assert/strict';
const records = [
  'BEGIN:VCALENDAR',
  'VERSION:2.0',
  'PRODID:-//Example Workshop//Calendar//EN',
  'BEGIN:VEVENT',
  'UID:mesa-42@example.invalid',
  'DTSTAMP:20261206T000000Z',
  'DTSTART:20261211T090000Z',
  'DTEND:20261211T100000Z',
  'SUMMARY:Print workshop',
  'LOCATION:Main workshop',
  'BEGIN:VLOCATION',
  'UID:main-workshop@example.invalid',
  'NAME:Main workshop',
  'END:VLOCATION',
  'BEGIN:VLOCATION',
  'UID:east-entrance@example.invalid',
  'NAME:East entrance',
  'END:VLOCATION',
  'END:VEVENT',
  'END:VCALENDAR',
];
const ics = records.join('\r\n') + '\r\n';
function readLocations(data) {
  const lines = data.split('\r\n');
  const base = lines.find(line => line.startsWith('LOCATION:'))?.slice(9);
  const rich = [];
  let location = null;
  for (const line of lines) {
    if (line === 'BEGIN:VLOCATION') location = {};
    if (location && line.startsWith('UID:')) location.uid = line.slice(4);
    if (location && line.startsWith('NAME:')) location.name = line.slice(5);
    if (line === 'END:VLOCATION') {
      rich.push(location);
      location = null;
    }
  }
  return {base, rich};
}
const view = readLocations(ics);
assert.equal(view.base, 'Main workshop');
assert.deepEqual(view.rich.map(row => row.name), ['Main workshop', 'East entrance']);
assert.equal(new Set(view.rich.map(row => row.uid)).size, 2);
assert.equal(ics.includes('\nDTEND:20261211T100000Z\r\n'), true);
console.log(JSON.stringify({node:process.version, checks:4, ...view}));

Preserve source data as the calendar grows

An organizer that reuses the same room across ten events can derive its named venues from one maintained directory. VLOCATION also provides a way to carry structured information alongside plain values. A publisher with a location card, for example, can attach a reference to the relevant place. The local fixture uses names and identifiers only and does not need network access. When adding a linked detail, retain enough basic text for the event to remain understandable if the linked page changes or disappears. A small versioned set of examples can reveal when a client silently drops richer components. An export and re-import check can compare event identity, timing and the available locations as separate observations.

Test the effect of revising one place

A practical fixture set varies one part of the same event at a time. Start with one venue, add the east entrance, then change its display label while keeping its identifier. Keep the start and end times fixed throughout those changes. Also exercise a basic view that reads only the top-level location. Useful access directions should remain discoverable for that reader. Record which application views retained the new component and which information the publisher supplied in the base event. The next release can then repeat those checks after any change to rendering or export. RFC 9073 gives a publisher a way to express multiple places independently while continuing to carry the familiar event and location information for its established consumers.

278 reads ✎ Write a comment

Reader discussion

Discussion prompt

Which data would you verify before applying this development in your field?

No comments yet. Be the first to contribute.

Write a comment

Comments are real visitor contributions. Repeated, link-heavy or abusive submissions may be limited.