Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Weekly calendar shows TUESDAY as first day on Sundays (with startDayOfWeek = 1) #1198

Closed
victorvogelpoel opened this issue Jul 10, 2022 · 5 comments · Fixed by #1214
Closed

Comments

@victorvogelpoel
Copy link

victorvogelpoel commented Jul 10, 2022

Version

tui calendar 2.02 (JS)

Test Environment

Brave browser

Current Behavior

On a SUNDAY (today), the calendar shows TUESDAY as the first column of the weekly calendar, and MONDAY is the last.

Today is Sunday, July 10th. When I change the laptop's date to July 11 (MONDAY), the weekly calendar shows the expected weekly calendar with first column MONDAY and last column SUNDAY.
Settings use "startDayOfWeek" = 1:

    var Calendar = window.tui.Calendar;
      var cal = new Calendar('#app', {
        defaultView: 'week',
        isReadOnly: true,
        useDetailPopup: true,
        timezone: { zones: [ { timezoneName: 'Europe/Amsterdam' } ] },
        week: {
          showNowIndicator: false,
          startDayOfWeek: 1,
          hourStart: 8,
          taskView: false,
          narrowWeekend: true,
        },
      });

image

Expected Behavior

On SUNDAY (today, or any day of the week), I expect the first column of the weekly calendar to be MONDAY and SUNDAY the last.

@adhrinae
Copy link
Contributor

@victorvogelpoel
I assume that setting the default timezone brought the bug. I forgot to apply the timezone when creating the range of the week.

Just to get more context, How many time differences between your timezone and Amsterdam(because you set it)?

@victorvogelpoel
Copy link
Author

Hello @adhrinae,

Amsterdam is the timezone I am in and the browser/Windows is working in, so no timedifference.

I was hoping setting the timezone would trigger proper locale for time display (eg 24h display); figuring out the templating...

@adhrinae
Copy link
Contributor

@victorvogelpoel

I couldn't reproduce the error in the sandbox below:

https://codesandbox.io/s/calendar-startdayofweek-bug-o491nd

Do you get the same result as you reported? I'm unsure what brings the problem if there is no time difference between your system and the timezone option.


You might need to check this documentation about the locale for time display. Unfortunately, we don't offer automatic formatting by the timezone.

@victorvogelpoel
Copy link
Author

And can you reproduce if you set your computer's date to July 10th (yesterday Sunday)? I think it will show TUESDAY as the first column then.

The bug was apparent yesterday, Sunday. Then I set my laptop's date to Monday July 11th, and the week calendar showed Mondays as the first column, as expected.

@adhrinae
Copy link
Contributor

@victorvogelpoel
Yeah, I got it. It's definitely not related to the timezone.

So the startDayOfWeek option is broken When the current time is on Sunday.

I'll investigate the issue and try to fix it. Thanks for the report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants