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

Can't select today's or yesterday's date in Date picker #3

Open
C0rn3j opened this issue Dec 17, 2023 · 4 comments
Open

Can't select today's or yesterday's date in Date picker #3

C0rn3j opened this issue Dec 17, 2023 · 4 comments

Comments

@C0rn3j
Copy link

C0rn3j commented Dec 17, 2023

The website (https://fitbit-report.arpanghosh.com/ - for me, right now) defaults to 2021-12-27 -> 2023-12-16, it is currently 2023-12-18, so it is missing two days of data, and there is no way to select today's date...

(https://fitbit-api-web-ui.onrender.com/ Is broken in the same fashion except for a different range.)

image


Smaller issue is that clicking the second field shows date picker from the first field, i.e. clicking 2023 field shows 2021 date making me have to scroll for two years.

Because of the above issue, there is no way to know which year is actually selected here. It would be better if the text just fit the box so it were always visible in the first place.

image

@arpanghosh8453
Copy link
Owner

The issue is the local time zones and Fitbit syncing with its own server. My server sits at a different time zone than yours, and sending an API request with the future date broke everything. As this project is focused on long-term trend visualization, I decided to remove 48 hours from the current time selection so everything works fine no matter which time zone the client is from. That is not a bug; it's a deliberate choice I made to avoid issues.

You are right on the UI part though, I can make them wider with CSS to they are more visible. Thank you for suggesting that.

The two sites are deployed from two different branches. One with experimental ( longer time span ) and the other one with 2-year max span. The selection rage works accordingly.

@C0rn3j
Copy link
Author

C0rn3j commented Dec 18, 2023

You are right on the UI part though, I can make them wider with CSS to they are more visible. Thank you for suggesting that.

Could you please keep the issues that still need to be worked on open? It's making it a bit hard to track and test when it actually gets fixed if everything is closed before committing the fixes.

One with experimental ( longer time span ) and the other one with 2-year max span. The selection rage works accordingly.

Would be nice to mention that in the readme :)

My server sits at a different time zone than your [client]

Why would that matter for requesting data from Fitbit API?

The selection rage works accordingly

But the issue is that no matter if you click the left date box or the right date box, it always chooses the currently-chosen month as the left box, even if you click on the right box.

I.e.

[ 2021-01 ] [ 2023-12 ]

Click left -> opens Jan 2021

Click right -> opens Jan 2021

Clicking right should open December 2023

@arpanghosh8453
Copy link
Owner

Why would that matter for requesting data from Fitbit API?

  • Some data points are returned as local time zones and also the server time can be ahead of your actual time ( resulting in requesting data from future )

@C0rn3j
Copy link
Author

C0rn3j commented Dec 18, 2023

I was able to get the data for today from the API after getting rid of the two - 1 day workarounds, I think it'd be better to fix the timezone issue rather than have this workaround applied.

If the issue happens because server has a timezone disconnect with client that somehow needs to be communicated to the API, can't the client just inform the server of its timezone?

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