Skip to content

profile: Display user's local time #292

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

Open
sirpengi opened this issue Aug 31, 2023 · 6 comments
Open

profile: Display user's local time #292

sirpengi opened this issue Aug 31, 2023 · 6 comments

Comments

@sirpengi
Copy link
Contributor

sirpengi commented Aug 31, 2023

In the profile screen (#195 ) we should show the current time in the user's configured timezone. This will involve integrating timezone data.

We've identified https://pub.dev/packages/timezone as a good candidate (chat thread) and an initial attempt was already made to integrate it, but the initialization of the database was measured to take ~100ms during bootup. It would make sense to delay the initialization of the database until we need to display the profile screen.

A followup issue will be:

@sirpengi
Copy link
Contributor Author

Adding for future note: switching to the 10y db (that is 25% the size of the normal db) cut the initialization time to ~50ms. However, since all we are doing is showing the current time, I wonder how much we can cut this database down by as we won't need historic information at all. Will we ever need to render historic datetimes to some arbitrary local time?

@gnprice gnprice added this to the Beta milestone Aug 31, 2023
@gnprice
Copy link
Member

gnprice commented Aug 31, 2023

Added some thoughts in chat. In short: that 10y database is a good find and we should totally use it; but probably cutting the database down further wouldn't get us below like 30-40ms, so not enough gain to be worth modifying the package.

@gnprice
Copy link
Member

gnprice commented Aug 31, 2023

Also it'd be good to repeat the measurement of the initialization time (a) in release mode or profile mode rather than debug mode, (b) on phone hardware rather than desktop hardware.

I expect it won't be so radically faster as to change the conclusion that we should defer the initialization away from app startup, but it might affect how we feel about different kinds of mitigations at the time when the user opens the profile screen.

@Komyyy
Copy link

Komyyy commented Feb 3, 2025

Hello, I'm an new contributor.
I implemented this in my branch by using FutureBuilder.
I'll make docs, tests and PR later.

@Komyyy
Copy link

Komyyy commented Feb 3, 2025

This is my draft PR: #F1318

@Komyyy
Copy link

Komyyy commented Feb 17, 2025

To test this feature in #1318, I made the PR #1363, which adds testable version of DateTime.now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

3 participants