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

week view problem #432

Closed
hugocaldeira opened this issue Jan 9, 2018 · 5 comments
Closed

week view problem #432

hugocaldeira opened this issue Jan 9, 2018 · 5 comments

Comments

@hugocaldeira
Copy link

Hi,
When a duration of an event is longer than one day and if the ending hour is earlier than the starting hour, in the week view the event doesn't span to the last day. Please see the attached images.

ok

notok

Am I doing anything wrong?

HC

@mattlewis92
Copy link
Owner

It seems like a timezone issue to me, new Date('2018-01-12 14:00:00') will default to UTC and adjust to your local timezone, so unless your browsers timezone is UTC you'll get weird issues like this. Instead you should encode timezones in the string you pass to new Date() in an ISO format like 2018-01-09T15:02:13+00:00 (where the +00:00 at the end is the timezone offset of your date)

@hugocaldeira
Copy link
Author

Hi,
I have tried with your examples and it is the same.
3

HC

@mattlewis92
Copy link
Owner

Ah, thanks, I can reproduce, will look into it when I have some free bandwidth. Or if you wanted to take a stab at fixing it yourself you could add a failing test with those dates here and then fix the problem in the getWeekViewEventSpan function here. (Maybe changing line 233 to span = differenceInDays(addDays(endOfDay(event.end), 1), begin) * SECONDS_IN_DAY;)

@mattlewis92 mattlewis92 reopened this Jan 10, 2018
@hugocaldeira
Copy link
Author

Yes, it worked. Problem solved!
Thank you, Matt

Hugo.

@mattlewis92
Copy link
Owner

Fixed in 0.23.2, thanks for reporting! 😄

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

No branches or pull requests

2 participants