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

Event Date Calculations #367

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

cohoe
Copy link
Member

@cohoe cohoe commented Jan 20, 2025

This does a couple things:

  1. Goes back to the old method of returning events for a given day in EventController.swift. I believe the original method of the first elements in the array being the events with a startTime after midnight is the least confusing. We already include events with a startTime after midnight at the end of the array for the previous day. The current code that includes events with an endTime leads to confusion such as "the first event in the list on Monday is yesterdays New York Pizza Service". From the perspective of the user most clients already operate with "Late Day Flip" meaning that late events after midnight will be included on that day. If a user opens the events screen between midnight and 3AM they are going to get the previous day schedule (aka the late one that they are now in). Opening at or after 4AM will return the current day (which has yet to happen because its 4AM why are you up) which odds are you don't care about anything that happened last night because it's already happened.

  2. Fixes a Daylight Savings related bug with getDateInCruiseWeek. Tricordarr was seeing event notifications be generated 1h10m before events rather than 10m before but only on certain days. This is because the previous code did not address the translation correctly from "now" to "then" while also accounting for DST.

  3. To support developing 2) above, we now have tests that work! Mostly stripping out old code that didn't work. But now swift test does something (well, if you also have the containers and migrations done). Haven't written docs for this yet.

  4. Fixes a Tricordarr client config example issue

@cohoe cohoe linked an issue Jan 20, 2025 that may be closed by this pull request
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

Successfully merging this pull request may close these issues.

Resurrect the tests
1 participant