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

An option to change the start hour of a day - Handling past-midnight events of the current/previous day #140

Open
Terrance opened this issue Jun 16, 2024 · 9 comments
Assignees

Comments

@Terrance
Copy link

The top of my event list starts with events that end after midnight on the current date, which may include entries I'd consider "yesterday". Events crossing midnight also end up spanning two day sections in the list.

It would be nice if there was an option to offset the time (from midnight) at which a new day is considered to start, and align events in the daily sections accordingly. For example, I'd set mine to +4 hours or 4am as the midpoint of when I'd expect to be asleep -- the "today" section (on say 2024-06-16) would then show events from 2024-06-16 04:00:00 to 2024-06-17 04:00:00, at which point the daily sections would shift up by one.

@yvolk
Copy link
Member

yvolk commented Jun 18, 2024

Currently the widget breaks one event that crosses midnight into two parts. The second part starts at midnight and ends at the the time the event ends.
So you actually suggest to hide that second part (or the last part of a multiday event, or any event that starts at midnight) in a case:

  • this event/part starts at a start time of the filtered period of events
  • AND it ends before some predefined hour of a day.

?!

For this option to be turned on we need to set it to any value in a range from 1 to say 23 ?!

How could we call this option?

@Terrance
Copy link
Author

Currently the widget breaks one event that crosses midnight into two parts.

It does, and I don't have a problem with that, though it may be an interesting corner case for shifting the hour of the new day.

Multi-day "all day" events (without times) should continue to display under their respective dates, regardless of any offset. Otherwise, for events with times, they should continue to span the necessary dates, but taking into account any offset.

Some example ranges and how I'd expect the event to appear in the widget (here assuming a +4 hour offset):

  • Monday 9am → Tuesday 5pm (unchanged from current behaviour)
    • Mon: 9am →
    • Tue: → 5pm
  • Monday 5pm → Tuesday 2am (end date is considered part of the same day due to the offset)
    • Mon: 5pm → 2am
  • Tuesday 2am → Tuesday 9am (end date is no longer considered part of the same day due to the offset)
    • Mon: 2am →
    • Tue: → 9am

For this option to be turned on we need to set it to any value in a range from 1 to say 23 ?!

How could we call this option?

Yes, I think the easiest presentation would be a range of 0 to 23 hours, where 0 retains the current behaviour. Alternatively, it may make more sense to make the range -12 to +12, as setting it to 23 would cause you to be nearly a day out of sync.

Here's the UI for a similar option in Anki to choose when it considers it to be the next day for learning:

@yvolk
Copy link
Member

yvolk commented Jun 27, 2024

@Terrance I see that we described the change behavior differently.
I thought that changes at the start (top) of a list of events are enough (as you described in your first message),
but now I see that you think about changes (start of day shift) in the whole list...

Monday 5pm → Tuesday 2am (end date is considered part of the same day due to the offset)

  • Mon: 5pm → 2am

Seeing on Monday "→ 2am" for an event that actually ends on the next day will be confusing... but maybe not for a person, who decided that his day starts at 4am...

It's interesting how do feel people who live near the International Date Line https://en.wikipedia.org/wiki/International_Date_Line

Interesting calendar tweak. I wonder how many users may actually like it...
This request looks similar: https://support.google.com/calendar/thread/957275/how-do-i-change-the-start-and-end-times-of-my-day

@yvolk yvolk changed the title Handling past-midnight events of the current/previous day An option to change the start hour of a day - Handling past-midnight events of the current/previous day Jun 27, 2024
@Terrance
Copy link
Author

Terrance commented Jun 28, 2024

A little more context: I use my calendar as an activity tracker, so I tend to have a large number of relatively short events.

If I stay up past midnight, I'd prefer to still see the current "logical" (i.e. from wake to sleep) day's worth of events rather than the "physical" (midnight to midnight) day.

4am is chosen somewhat arbitrarily -- my sleep times vary, but in my case that makes for a good average time where I'll definitely be in bed (7+ hours of sleep is wider than the window of potential sleep hours).

I've seen similar options in a few time-based apps (ActivityWatch, Anki, Simple Time Tracker, Sleep as Android to name a few) and it is also nice to have my various apps agree on this.

Seeing on Monday "→ 2am" for an event that actually ends on the next day will be confusing...

For comparison, in conversation I'd probably also refer to 2am on Tuesday as "Monday night" still, but I can see not everyone would do so (this may well be a regional thing -- as a British person this makes sense to me, but maybe we're in the minority?) or want this behaviour, hence the request for an option to set this up.

@yvolk
Copy link
Member

yvolk commented Jul 1, 2024

"Start of next day" in AnkiDroid https://ankidroid.org/docs/manual.html#_reviewing

Start of next day
Controls when AnkiDroid should start showing the next day’s cards. The default setting of 4AM ensures that if you’re studying around midnight, you won’t have two days worth of cards shown to you in one session. If you stay up very late or wake up very early, you may want to adjust this to a time you’re usually sleeping.

@yvolk
Copy link
Member

yvolk commented Jul 14, 2024

I see many similar usages a "Start hour of a day" option, so I'm choosing this name for the new feature.

@yvolk yvolk self-assigned this Dec 15, 2024
yvolk added a commit that referenced this issue Jan 8, 2025
@yvolk
Copy link
Member

yvolk commented Jan 8, 2025

@Terrance
Copy link
Author

Terrance commented Jan 9, 2025

Thanks for implementing this! I've had a play with my usual calendar events and it seems to work exactly as I'd expect. 🙂

@yvolk
Copy link
Member

yvolk commented Jan 12, 2025

@Terrance In v.4.11.1. I also improved filtering of past events according to the new meaning of a Start hour of a Day.

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