Business · Product · Technology · AI

Filter booking slots by clinic day and preserve repeated local hours

A Movo-X cross-platform scheduling case covering clinic-zone day filtering, instant-based deduplication, display-time independence and repeated-hour fixtures.

Work directly with Omer Muneer Qazi · Reviewed 29 November 2026

The scenario: a booking day belongs to a clinic, not to the phone

A person choosing an appointment can be in a different time zone from the clinic. A response can also contain a formatted time string alongside the actual start instant. If the app groups slots using the phone’s day or the display string, a valid appointment can appear on the wrong date or in the wrong part of the day.

The inspected Movo-X Android and Swift helpers filter availability using an explicit clinic zone and compare actual start instants. This case traces the two implementations and selected mirrored fixtures. It concerns client-side presentation of supplied availability, not the database decision to reserve a slot.

Use the selected clinic day as an explicit input

Both helpers receive the requested calendar day, clinic time zone and current instant. They keep slots starting after now whose start falls on that day in the supplied clinic zone. The selected day-filter fixtures include starts around the clinic-day boundary, an earlier start, a malformed value and a repeated instant.

This gives the filtering operation a clear context instead of reading the device’s current date implicitly. The caller still has to provide the correct zone and day. A helper accepting an explicit zone does not establish that every clinic profile is configured correctly or that the user interface always selects the intended clinic.

Normalize malformed input at the boundary each platform actually uses

Android’s helper receives string-based slot models and attempts to parse each start instant while building its filtered list. Values that cannot be parsed do not enter that list. Swift’s response model instead decodes slots into typed dates and drops malformed elements before its availability helper receives them.

The mirrored fixtures check the resulting useful slots, but the failure-isolation boundary is not identical source code. Documenting where parsing occurs makes error handling easier to review. It also avoids assuming that every helper can safely accept arbitrary raw values: downstream period grouping should operate on the validated and filtered results.

Deduplicate by a real start instant rather than a local label

Both availability helpers remove repeated start instants and order the remaining slots chronologically. Their selected example checks that two copies of one instant become a single entry. This is a specific presentation identity rule for the supplied slot list.

It does not merge all slots whose wall-clock labels look the same. Two real instants can share a local hour during a time-zone transition, and those remain different candidates. It also does not establish that equal start instants across different doctors or resources are interchangeable; the helper’s input scope and any richer resource identity need their own contract.

Preserve both occurrences of a repeated local hour

The repeated-hour fixtures use two November start instants in the America/New_York zone and assert that both remain in the selected clinic-day result. Each corresponds to a real start even though the local clock can display the same hour twice during that transition.

This is why instant-based deduplication matters. A local-time string is useful for display but can be insufficient as an identifier. These fixtures check the portable time libraries on the research machine; they do not establish actual clinic operating hours, server-generated availability or the visual distinction the app presents between repeated labels.

Derive morning, afternoon and evening from the clinic-zone instant

The period helpers compute the hour from startsAt in the supplied clinic zone. A fixture deliberately provides a misleading display time and checks that it does not change the selected morning period. Additional examples check the noon and evening boundaries.

Swift also exposes ordered available periods and an initial-period helper. The initial helper takes the first supplied slot, so its meaning depends on the caller supplying the intended order; the filtered slot helper already returns chronological order. The inspected Android screen similarly selects a period from the filtered results. This is grouping logic, not proof that every displayed string is localized correctly.

Availability presentation does not hold the appointment

The client can remove past entries and display a coherent clinic day while another person reserves a slot between loading and confirmation. A supplied list is therefore an availability observation, not a lock. Booking acceptance, concurrency and request-idempotency behaviour belong to the reservation path.

No real appointment was created, cancelled or held during these checks. The fixtures also do not validate payment, reminder delivery or admission to a later call. Keeping these responsibilities separate lets a team test time presentation without treating its successful result as a complete booking-transaction acceptance.

A practical cross-platform time acceptance package

Use the same named scenarios on both clients: clinic-day boundaries, past starts, malformed input, duplicate instants, misleading display strings and repeated local hours. Record the supplied zone and clock so a failure can be reproduced. Check results as instants before checking localized labels.

For a CTO, the benefit is a booking model with explicit temporal meaning. The source and selected fixtures show how these clients avoid using display strings as scheduling authority. Real availability generation, resource identity, concurrent reservations, deployed time-zone data and device presentation remain independently verifiable parts of the product.

Compare the reviewed boundaries

What identifies a booking slot

On smaller screens, scroll across to compare every column. Keyboard users can focus the table and use the arrow keys.

ValueRole in the reviewed helpersSeparate concern
Start instantFiltering, ordering and deduplicationReservation and resource identity
Clinic zone and selected dayCalendar-day membership and periodCorrect profile/caller configuration
Display time stringNot used as grouping authorityLocalization and repeated-label clarity
Loaded availability listCandidate presentationConcurrent server booking acceptance

Illustrative control flow

Pseudocode summarizing the decision boundary. It is not copied production code or a deployment instruction.

valid_slots = parse_or_decode_start_instants(response)
selected = valid_slots.filter(start_after_now_and_on_clinic_day)
selected = unique_by_start_instant(selected).sort_by_start()
periods = group_by_clinic_zone_hour(selected)

# Confirming a booking still requires the authoritative reservation path.

About this engineering series

Written by Omer Muneer Qazi from a review of Movo-X implementation and dated engineering records. This article explains source behaviour and historical observations; current production, clinical outcomes and store availability require their own verification. Examples are synthetic and proposed test cases are identified as such.

Explore the Movo-X engineering series → · Related implementation experience →

Discuss a similar engineering problem

Send the workflow, current platform and the decision your team needs to make. I can help define an implementation or review scope with concrete acceptance evidence.

Discuss your project on WhatsApp ↗
WhatsApp Omer about this project ↗