mendixlabs / CalendarWidget

This is a calendar widget for Mendix. It shows a Calendar and can render objects as events in it.
https://appstore.home.mendix.com/link/app/248/Mendix/Calendar-widget
Apache License 2.0
9 stars 28 forks source link

Mx 7.11 Bugs - Date changes back one day when saving #65

Open lambatross opened 6 years ago

lambatross commented 6 years ago

After I open a calendar item, I save/close it without making any changes and the calendar item switches dates to be a day earlier than it was when I initially opened it.

rickyv3 commented 6 years ago

Hey Jelte,

How's the fix for this issue coming along? Got a timetable you can share?

JelteMX commented 6 years ago

I am working on a bugfix which is related to this issue. Could you test a (not-released) version of the widget for me?

https://github.com/mendix/Calendar/raw/version6-refactoring/dist/Calendar.mpk

This will be version 6 when all issues has been resolved. This version right now is not production ready yet

lambatross commented 6 years ago

Hi Jelte - Thanks for providing this update. It looks like part of the issue has been addressed.

  1. When opening the schedule item and saving, the date does not change. Pass.
  2. When dragging and dropping the schedule item, the date still changes to a day earlier than expected. Fail.

For both of the above situations, the same microflow is being called, so it appears this is still a bug in the widget. Please let us know if you need any additional information.

JelteMX commented 6 years ago

I am aware of the bug, thanks for testing. I have this same bug open for Support. I am working on resolving the issue

JelteMX commented 6 years ago

I think I have found the issue in the code. On Change (it did this on click as well) it will change the date and time. It seems to ignore the previous set time and just set this to 00:00. It should only change the date (if you are on a Month view. For weeks it should be different, because you can change the time by dragging it through a day).

Lots of edge cases (Timezones are a whole different story), but I'll try to come up with a fix soon.

JelteMX commented 6 years ago

I will probably revert the change, because this boils down to an implementation issue, not an issue with the widget itself. Here's the short summary I wrote to Support:


I'm analyzing the issue further and it comes down to some implementation failures. I do think we need to better document it, but it comes down to this:

  • The client has implemented a Sub microflow that does some validation but also changes the date/time in that. The widget takes care of changing the date/time, so this shouldn't have to be done in a sub microflow.
  • The client also uses the allDayAttribute. In my research I found out that the widget will always reset the time to 00:00 UTC when you will drag the event around in a month/week view, if the event is an all-day event. So, disabling the all-day attribute in an event will prevent this.

These implementation issues should be resolved in the project itself. I will see if I can do something about the timezones, because this might be a problem as well.

JelteMX commented 6 years ago

Can you tell what the timezones are that are used, reproducing this issue?

This will help to check for the issues regarding timezones. I think it has to do with that.

JelteMX commented 6 years ago

@rickyv3 & @lambatross, can you share with me the details in my previous question? I am trying to figure out what to do with timezones

lambatross commented 6 years ago

Hi Jelte – Sorry for the delay. Answers below: