Implementing a Booking Date and Time Picker Component

When developing a booking service for a network of medical clinics, we found that every fifth patient lost their reservation due to a time zone bug. The server stored all dates in UTC, while the frontend converted them to local time with an error—slots shifted by an hour during daylight saving time

Development and maintenance of all types of websites:

Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Our competencies:

Frequently Asked Questions

Latest works

  • Development of a web application for FEEDME
    Development of a web application for FEEDME
    1320
  • Development of an online store for the company FURNORO
    Development of an online store for the company FURNORO
    1276
  • Development of a web application for Enviok
    Development of a web application for Enviok
    1019
  • CRM development for Chasseurs
    CRM development for Chasseurs
    1075
  • Website development for SBH Partners
    Website development for SBH Partners
    1137
  • Website development for Red Pear
    Website development for Red Pear
    576

When developing a booking service for a network of medical clinics, we found that every fifth patient lost their reservation due to a time zone bug. The server stored all dates in UTC, while the frontend converted them to local time with an error—slots shifted by an hour during daylight saving time transitions. An audit revealed that 95% of problems were related to conversion. This is a typical story: the UI calendar seems simple, but under the hood it requires real-time synchronization, time zone awareness, and double-booking protection. Without a solid architecture, users see unavailable slots or lose their bookings.

Problems We Solve

Time Zone Conversion

Server stores time in UTC, client displays in the user's local time zone. If conversion is incorrect, a user might book a slot for tomorrow but see it as today. Proper conversion is critical:

// Convert server UTC to user's local time const localSlot = utcToZonedTime(slot.datetime_utc, userTimezone); const displayTime = format(localSlot, 'HH:mm', { timeZone: userTimezone }); 

For multi-regional projects, we let users explicitly choose a time zone—this reduces errors significantly. In one project with 10 time zones, complaints about incorrect times dropped by 80% after adding an explicit selector.

Double-Booking

We use pessimistic locking: when a slot is selected, it is temporarily reserved for 10 minutes. If the user cancels or does not complete the booking, the lock is released. Under peak load, this is more reliable than optimistic locking.

Approach Reliability Performance
Pessimistic High: no conflicts Medium: lock held during transaction
Optimistic Medium: requires re-check High: no locks

For critical resources (e.g., doctors, hotel rooms) we choose pessimistic locking; for mass events where occasional collisions are tolerable, we use optimistic locking.

Backend lock implementation with Redis and TTL:

import redis r = redis.Redis() def reserve_slot(slot_id, user_id, ttl=600): key = f"slot:{slot_id}:reserved" if r.setnx(key, user_id): r.expire(key, ttl) return True return False 

Typical implementation mistakes:

  • Not handling daylight saving time: slots can duplicate or disappear.
  • Storing timestamps in local format on the server—always use UTC.
  • Forgetting lock timeouts: if the user closes the browser, the slot remains taken forever.

How We Do It (Case Study)

On a medical clinic project, we diagnosed that 95% of booking failures were due to time zone conversion bugs. We redesigned the backend to store all dates strictly in UTC and added a datetime_utc field to every slot. On the frontend, we used date-fns-tz to convert to the user's local time. For double-booking protection, we implemented pessimistic locking with Redis (10‑minute TTL). After deployment, booking loss dropped to nearly zero. The entire solution was built in 2 weeks.

Our Technology Stack

Frontend: React 18 / Next.js, TypeScript, date-fns-tz. Backend: Laravel 11 or Django 4, PostgreSQL, Redis. Infrastructure: Docker containers, CI/CD pipeline.

Comparison of popular date libraries:

Library Size (gzip) Time Zone Support GitHub Stars
date-fns 4.2 KB ✅ via date-fns-tz 30k+
dayjs 2.5 KB ✅ plugin 40k+
moment.js 16.7 KB ✅ built-in 47k+ (legacy)

What's Included in Our Work

  • Development of a calendar component with range selection and exception handling
  • Backend logic for time slots with Redis caching
  • Booking API with server-side validation (availability, time zones)
  • Component documentation and data schema
  • Code coverage with unit and integration tests
  • Deployment instructions

Our experience: over 10 years and 40+ successfully implemented projects. Clients typically reduce support incidents by up to 25%.

Process and Timelines

Estimation: We review your requirements and existing systems, then provide a fixed quote. Implementation steps:

  1. Collect data and analyze requirements
  2. Design frontend and backend architecture
  3. Develop and test the component
  4. Deploy and verify on your infrastructure

Time estimates:

  • Basic component for one resource: 2–3 business days
  • Multi‑region support, complex recurrence logic, integration with external systems (CRM): up to 2 weeks

Cost is determined after a free consultation. Contact us to get started.

Step-by-Step: Time Zone Conversion (Our Approach)

  1. Server stores all dates in UTC — no exceptions.
  2. Client receives slot list with datetime_utc field and user's time zone (from profile or geolocation).
  3. Using date-fns-tz on the frontend, convert each date to local time before rendering.
  4. When submitting a booking, send slot_id only — the server determines UTC from the slot ID.

Get a consultation — our engineers will help you choose the best solution for your project. Request a quote for your booking component.