nextcloud / nextcloud/calendar

Appointment availability intervals are generate in browser time zone and not calendar time zone

Open
#6,529 2 comments 0 reactions 1 assignee View on GitHub

@SebastianKrupinski is already working on this.

Since Nov 27, 2024.

1. to develop bug Feature: Appointments feature: language/translations (l10n/i18n)
Dominant language
JavaScript
Stars
1.2k
Forks
332
Avg merge
16h 13m
Merged PRs (30d)
137

Description

Steps to reproduce
  1. Change calendar to a different time zone then the browser time zone (Calendar: Europe/Berlin, Browser: America/Toronto)
  2. Create new appointment schedule (Mon to Fri, 9am to 5pm)
  3. Check appointment slots for schedule (use link)
Expected behavior

Appointment availability intervals should be created with calendar time zone

Actual behaviour

Appointment availability intervals are created with the browsers time zone

Calendar app version

Main

Test Results

Appointment availability Intervals created with:

Calendar set to Europe/Berlin
Browser set to America/Toronto
Time set to 9am to 5pm

{
    "timezoneId": "Europe\/Berlin",
    "slots": {
        "MO": [
            {
                "start": 1732543200,
                "end": 1732572000
            }
        ],
        "TU": [
            {
                "start": 1732543200,
                "end": 1732572000
            }
        ],
        "WE": [
            {
                "start": 1732543200,
                "end": 1732572000
            }
        ],
        "TH": [
            {
                "start": 1732543200,
                "end": 1732572000
            }
        ],
        "FR": [
            {
                "start": 1732543200,
                "end": 1732572000
            }
        ],
        "SA": [],
        "SU": []
    }
}

Epoch conversion for Monday start in Europe/Berlin

1732543200 converts to Monday November 25, 2024 15:00:00 (pm) in time zone Europe/Berlin (CET)

Epoch conversion for Monday start in America/Toronto

1732543200 converts to Monday November 25, 2024 09:00:00 (am) in time zone America/Toronto (EST)
Issue

Appointment availability intervals are created with the browsers time zone and not the calendars.

A secondary issue is that epoch is a static number of seconds from a specific start point and defines a different time for every time zone. Epoch time will also differ during Standard and Daylight Savings time.

Solution

Use seconds from start of day for availability intervals

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.