Skip to content

Appointment slots are generated for the wrong day due to UI sending date in epoch #6528

@SebastianKrupinski

Description

@SebastianKrupinski

Steps to reproduce

  1. Create appointment schedule in local time zone (Europe/Berlin) UTC+1
  2. Change browser time zone to (Asia/Jerusalem) UTC+2
  3. Select a date e.g. 2024-11-26

Expected behavior

Should show slots for 2024-11-26

Actual behaviour

Shows slots for 2024-11-25

Calendar app version

Main

Test Results

Selected November 26, 2024 in Asia/Jerusalem which is epoch 1732579200000.

Epoch conversion for Asia/Jerusalem time zone

1732579200000 converts to November 26, 2024 00:00:00 (am) in time zone Asia/Jerusalem (IST)

Epoch conversion for Europe/Berlin

1732579200000  converts to November 25, 2024 23:00:00 (pm) in time zone Europe/Berlin (CET)

Epoch conversion for America/Toronto

1732579200000  converts to November 25, 2024 19:00:00 (pm) in time zone America/Toronto (EST)

Issue

UI sends the date in the browsers time zone as epoch without sending the actual time zone. The issue is that epoch is a static number of seconds from a specific start point and defines a different time for every time zone, so once the configuration time zone is applied to the date, this causes the date to roll back one day causing slots to be generated for the wrong date. Epoch time will also differ during Standard and Daylight Savings time.

Solution

Use string date instead of epoch time stamp

Metadata

Metadata

Labels

Type

Projects

Status

☑️ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions