superlou / zenkaikon24

0 stars 0 forks source link

Everything on the Today display resets after Midnight to their opening times even if event is still open #18

Closed kd2gfn closed 7 months ago

kd2gfn commented 8 months ago

I set the time to 23:30 on the 22nd, when time passed midnight everything was updated but I saw a problem on the TODAY display.

Everything on the Today display reset to their opening times even if it was still open.

Example: The shuttle bus stops at 1:30 am, but when time passed midnight and a guidebook update occurred, the shuttle bus changed from closing at 1:30 am to opening at 9:30 am. This happened for other events that stay open past midnight as well.

superlou commented 8 months ago

What was the specific debug datetime and acceleration you were using?

Edit: Just saw your email. Added it to your description.

superlou commented 8 months ago

The logic for an all-day session is simply (where min_duration is 3.5 hours):

    if s["starts_today"] and s["duration"] > min_duration

The logic for starts_today is:

def starts_today(now, start):
    today_midnight = now.replace(hour=0, minute=0, second=0, microsecond=0)
    today_start = today_midnight + timedelta(hours=5)
    today_finish = today_start + timedelta(hours=24)
    return today_start <= start < today_finish

I think the problem is that the threshold for something starting "today" can't be midnight. It has to be something like 4 am.

kd2gfn commented 8 months ago

I did 2 ways to check.

First way was with an acceleration of 2. I set date and starting time to 2024-03-22T23:30:00 and let it run. When it went past midnight and did a guidebook update the today screen reset everything to there starting times for the day even when when some events had an ending of 1:30 am.

Second was with an acceleration of zero and date/time2024-03-22T00:01:00. It did a guidebook update and same thing happened. Today screen events were set to opening and none of the events that should close after midnight showed the closing time

Bert

On Thu, Mar 7, 2024, 12:47 PM superlou @.***> wrote:

The logic for an all-day session is simply (where min_duration is 3.5 hours):

if s["starts_today"] and s["duration"] > min_duration

The logic for starts_today is:

def starts_today(now, start): today_midnight = now.replace(hour=0, minute=0, second=0, microsecond=0) today_start = today_midnight + timedelta(hours=5) today_finish = today_start + timedelta(hours=24) return today_start <= start < today_finish

I think the problem is that the threshold for something starting "today" can't be midnight. It has to be something like 4 am.

— Reply to this email directly, view it on GitHub https://github.com/superlou/zenkaikon24/issues/18#issuecomment-1984109698, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJXCDQ2SBX3AYCJ6I5K7SHDYXCR4FAVCNFSM6AAAAABELJY6MKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBUGEYDSNRZHA . You are receiving this because you authored the thread.Message ID: @.***>

superlou commented 8 months ago

Do you know what time the last event in a "day" ends?

On Thu, Mar 7, 2024 at 2:46 PM kd2gfn @.***> wrote:

I did 2 ways to check.

First way was with an acceleration of 2. I set date and starting time to 2024-03-22T23:30:00 and let it run. When it went past midnight and did a guidebook update the today screen reset everything to there starting times for the day even when when some events had an ending of 1:30 am.

Second was with an acceleration of zero and date/time2024-03-22T00:01:00. It did a guidebook update and same thing happened. Today screen events were set to opening and none of the events that should close after midnight showed the closing time

Bert

On Thu, Mar 7, 2024, 12:47 PM superlou @.***> wrote:

The logic for an all-day session is simply (where min_duration is 3.5 hours):

if s["starts_today"] and s["duration"] > min_duration

The logic for starts_today is:

def starts_today(now, start): today_midnight = now.replace(hour=0, minute=0, second=0, microsecond=0) today_start = today_midnight + timedelta(hours=5) today_finish = today_start + timedelta(hours=24) return today_start <= start < today_finish

I think the problem is that the threshold for something starting "today" can't be midnight. It has to be something like 4 am.

— Reply to this email directly, view it on GitHub < https://github.com/superlou/zenkaikon24/issues/18#issuecomment-1984109698>,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/AJXCDQ2SBX3AYCJ6I5K7SHDYXCR4FAVCNFSM6AAAAABELJY6MKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBUGEYDSNRZHA>

. You are receiving this because you authored the thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/superlou/zenkaikon24/issues/18#issuecomment-1984307249, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFNIP65J7FQKLZVE5V2P2TYXC7ZXAVCNFSM6AAAAABELJY6MKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBUGMYDOMRUHE . You are receiving this because you commented.Message ID: @.***>

kd2gfn commented 8 months ago

You would check with Chet as I'm at work now, don't have access to guidebook here. I know there are events that go to 1:30 am, but not sure if anything goes beyond that

On Thu, Mar 7, 2024, 4:32 PM superlou @.***> wrote:

Do you know what time the last event in a "day" ends?

On Thu, Mar 7, 2024 at 2:46 PM kd2gfn @.***> wrote:

I did 2 ways to check.

First way was with an acceleration of 2. I set date and starting time to 2024-03-22T23:30:00 and let it run. When it went past midnight and did a guidebook update the today screen reset everything to there starting times for the day even when when some events had an ending of 1:30 am.

Second was with an acceleration of zero and date/time2024-03-22T00:01:00. It did a guidebook update and same thing happened. Today screen events were set to opening and none of the events that should close after midnight showed the closing time

Bert

On Thu, Mar 7, 2024, 12:47 PM superlou @.***> wrote:

The logic for an all-day session is simply (where min_duration is 3.5 hours):

if s["starts_today"] and s["duration"] > min_duration

The logic for starts_today is:

def starts_today(now, start): today_midnight = now.replace(hour=0, minute=0, second=0, microsecond=0) today_start = today_midnight + timedelta(hours=5) today_finish = today_start + timedelta(hours=24) return today_start <= start < today_finish

I think the problem is that the threshold for something starting "today" can't be midnight. It has to be something like 4 am.

— Reply to this email directly, view it on GitHub <

https://github.com/superlou/zenkaikon24/issues/18#issuecomment-1984109698>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AJXCDQ2SBX3AYCJ6I5K7SHDYXCR4FAVCNFSM6AAAAABELJY6MKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBUGEYDSNRZHA>

. You are receiving this because you authored the thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub < https://github.com/superlou/zenkaikon24/issues/18#issuecomment-1984307249>,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/AAFNIP65J7FQKLZVE5V2P2TYXC7ZXAVCNFSM6AAAAABELJY6MKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBUGMYDOMRUHE>

. You are receiving this because you commented.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/superlou/zenkaikon24/issues/18#issuecomment-1984536986, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJXCDQ6GT6NS332KXN32LK3YXDMGBAVCNFSM6AAAAABELJY6MKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBUGUZTMOJYGY . You are receiving this because you authored the thread.Message ID: @.***>

superlou commented 8 months ago

Figured it out. The problem is that the calculation of midnight is no good when the day rolls over. Going to try to push an update tonight.

superlou commented 8 months ago

Package is updated. It should be treating a "day" as 4 am one day to 4 am the next.

kd2gfn commented 8 months ago

I will update and give a try tonight. On Mar 7, 2024, 8:32 PM -0500, superlou @.***>, wrote:

Package is updated. It should be treating a "day" as 4 am one day to 4 am the next. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

kd2gfn commented 8 months ago

updated the pi, let it run at acceleration of 3. all looks good so far,

On Thu, Mar 7, 2024 at 8:57 PM Bert Goldschmidt @.***> wrote:

I will update and give a try tonight. On Mar 7, 2024, 8:32 PM -0500, superlou @.***>, wrote:

Package is updated. It should be treating a "day" as 4 am one day to 4 am the next.

— Reply to this email directly, view it on GitHub https://github.com/superlou/zenkaikon24/issues/18#issuecomment-1984890484, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJXCDQ2T2JJORK7DDA3LVJDYXEIMDAVCNFSM6AAAAABELJY6MKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBUHA4TANBYGQ . You are receiving this because you authored the thread.Message ID: @.***>

superlou commented 7 months ago

Closing as complete. Let me know if there are issues with this still!