Skip to content

Force time localization with in-app navigation#5

Merged
bartonjs merged 1 commit into
bartonjs:mainfrom
ladeak:main
Mar 31, 2026
Merged

Force time localization with in-app navigation#5
bartonjs merged 1 commit into
bartonjs:mainfrom
ladeak:main

Conversation

@ladeak

@ladeak ladeak commented Mar 31, 2026

Copy link
Copy Markdown
Contributor

Schedule does not run the script for the local timezone calculation when navigating within the blazor app (I live in Europe):
See the behavior before (it shows 10:00 and 11:00 instead of 19:00 when doing in-app navigation - but if I open the schedule page directly, it shows the correct time)

BEFORE:

old.mp4

AFTER:

after.mp4

This is not perfect though, if I navigate with the buttons here:
image

the time is sometimes localized, sometimes not. This annoys me, but

  • I never use those buttons
  • AI had no good idea either, and I spent shamefully too much time to try to figure this out.

Maybe @halter73 knows how to do this in a clean way? - I am open to refactor this PR.

<p class="mt-3 text-muted">
Videos are streamed to the <a href="https://www.youtube.com/@@NETFoundation/streams">.NET Foundation YouTube channel</a>.
This calendar is available <a href="@CalendarService.Url">as an .ics file</a> you can add to your favorite calendar app.
</p>

@ladeak ladeak Mar 31, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved this as is to a js file, and added observeUrlChange to trigger it.

@bartonjs bartonjs merged commit 5cce8e8 into bartonjs:main Mar 31, 2026
1 check passed
@bartonjs

Copy link
Copy Markdown
Owner

@ladeak The change is deployed. Changing the timezone on my phone and navigating forward/backward looks like it switches it back to "10:00", so if the fix works it doesn't work on iOS Safari 😦.

@ladeak

ladeak commented Apr 1, 2026

Copy link
Copy Markdown
Contributor Author

I tried new from desktop chromium/Firefox, android (edge), and iPhone (safari/edge) and they looked good, I guess there is something more to it.

@bartonjs

bartonjs commented Apr 1, 2026

Copy link
Copy Markdown
Owner

Tried again today and my phone almost always behaved. The times that it left things saying 10:00 weren't predictable, but I also don't really anticipate people browsing more than one month forward or backward.

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.

2 participants