The export lists appointments in booking order, so Dana’s Sunday comes before Fiona’s Friday. Python filters appointments for the week with if now <= start < now + WEEK and orders them with week.sort(key=lambda appt: appt["start"]). The port now has zoned start times, and it needs the same five appointments in time order.
Add a Week to a ZonedDateTime
clinicTime() wraps the two calls from the previous lesson, reading an Instant and converting it to London time. A Duration from Temporal.Duration.from({ days: 7 }) plays the part of timedelta(days=7), and .add() returns a new value, as datetime + timedelta does. Durations get their own lesson later. Save this as compare.js in ~/reminders and run it with node compare.js:
const CLINIC_ZONE = "Europe/London";
function clinicTime(text) {
return Temporal.Instant.from(text)
.toZonedDateTimeISO(CLINIC_ZONE);
}
const now = clinicTime("2026-10-29T08:00:00Z");
const WEEK = Temporal.Duration.from({ days: 7 });
const weekEnd = now.add(WEEK);
console.log(`${weekEnd}`);
The week ends at eight on Thursday morning in London:
2026-11-05T08:00:00+00:00[Europe/London]