CAWSCIT / ca-meeting-finder-issue-tracker

Public Repo For tracking known issues and work for the C.A. Meeting Finder app.
0 stars 0 forks source link

Find meetings main window displays "wrong" weekday meetings #51

Open TomToiviainen opened 1 month ago

TomToiviainen commented 1 month ago

When opening the current C.A. Meeting Finder (1.01), I go to 'Find Meetings', I select a weekday, for example Friday, and the listing displays Saturdays meetings on top. The friday meetings are a bit down in the list. This happens for any Weekday.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'FIND MEETINGS'
  2. Click on 'Any Day'
  3. Select 'Friday'
  4. Friday Meetings listings starts with Reaching Out at 12am Saturday.

Expected behavior I expected the Friday Meeting list to start from 12:00am Friday. . .

Screenshots image

. .

Smartphone (please complete the following information):

enderv commented 1 month ago

Probably timezone related - notes from slack happens in just the html as well for folks in sweden

KalobTaulien commented 1 month ago

I only had about 20 mins to look into this.

On iOS I had to change my system time to Sweden for Simulator to change its internal time. (Noting this for documentation in the future).

In the TSML UI config:

var tsml_react_config = {
  weekdays: [
    'monday',
    'tuesday',
    'wednesday',
    'thursday',
    'friday',
    'saturday',
    'sunday',
  ],
  ..

I noticed that the week seems to start at Monday in Sweden, rather than on Sunday. The above config seemed to fix the problem. I suspect if I change my timezone back to my own default timezone, it'll be one day offset again.

I'm not sure how to manage or detect the offset without making a direct change to the TSML UI code. If we can detect it via the App, then we can adjust the config in the meetings file.

That's as far as I am able to get today, but hopefully I can look more closely at this early next week.

TomToiviainen commented 1 month ago

Yes, somewhere around 1000 years ago, the bible became the source of weekdays in Sweden. On the 7th day god rested right? Ergo, Sunday is the last day of the week in Sweden.

KalobTaulien commented 1 month ago

I have a possible solution at https://github.com/CAWSCIT/ca-mobile-app/pull/64. Need some more dev eyes on this one though. @enderv or @TomToiviainen or @tiptop96 🙏

TomToiviainen commented 1 month ago

https://github.com/CAWSCIT/ca-mobile-app/pull/64 gives me a 404.

tiptop96 commented 1 month ago

Interesting, I don't understand why it happens only in the app, on our website the dropdown is still ordered starting on Sunday which is not preferable for us but it filters out the correct days: https://en.ca-sweden.se/moten?weekday=tuesday

I am setting up xcode which is taking some time, so haven't been able to run locally yet. 😅

tiptop96 commented 1 month ago

Haha it is always so hard to wrap my head around time related bugs! 😅

Anyways I tried just adding the weekdays to the web version to test it out. So I select Monday (day 0 with the new config), it shows me a bunch of meetings from Monday, followed by a bunch on Sunday. But on closer inspection they are all Sunday meetings in the timezone which they exist.

Here is the search and the first meeting, Monday in the search bar and Monday in the result (seems correct) image

However when looking at the meeting we can see that it is a Sunday meeting (even though it is a Monday meeting in Sweden which means we technically would like to see it) image

Further down we find meetings in our own timezone which are on Sunday even though we searched for Monday. image

image

I think the change is no good because it seem to put us off by one.

My guess is that the original issue is that the filter works with day numbers which gets really weird over timezones. It will filter Monday meetings from for example Florida but when they are translated to Swedish timezones they become Tuesday meetings. They probably end up at the top because they are in the early morning hours from Swedens perspective.

I saw that there was an issue open about this and I think that we might be better of fixing it there, probably by translating the meeting day for all meetings using the meeting time and the users timezone before filtering them out.

The order of the dropdown would be nice to fix for Sweden but we have hade it that way on the website for a while, it is not the end of the world and can probably be a separate issue.

KalobTaulien commented 1 month ago

You've described the problem perfectly. When using a Swedish calendar (calendar iso8601) the days are offset by 1.

PR https://github.com/CAWSCIT/ca-mobile-app/pull/64 is an attempt to look at the device calendar and tell the meeting list to offset by one.

I don't think https://github.com/CAWSCIT/ca-mobile-app/pull/64 is the right answer, but it's an answer with a possible working..ish solution for now. This definitely needs to be addressed in TSML-UI core, though - that would be the right place.

I've added some more details here: https://github.com/code4recovery/tsml-ui/issues/401#issuecomment-2284168743

This issue seems to exist when there's a mix of timezones. So on your website @tiptop96 if you're using CEST for all meetings, I believe it will work. It also works here: https://aasanjose.org/meetings. But with our app we are displaying lots of timezones, and something isn't quite functional between gregory and iso8601 calendar types. The link above shows more information.

The ordering of the days isn't an issue imo. Rather, displaying the correct days when filtering is the issue.