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

user based timezone response #26

Open
OutdatedVersion opened this issue Apr 1, 2020 · 10 comments
Open

user based timezone response #26

OutdatedVersion opened this issue Apr 1, 2020 · 10 comments
Assignees
Labels
bug Issue Label for Bug Reports hacktoberfest Hacktoberfest Related Pull Request or Issue help wanted Issue Label for Asking Help todo Issue Label for Todo Status

Comments

@OutdatedVersion
Copy link

Issue:
The system returns the time zone of the hosting server instead of the user

Reproduce:
1.

$ curl -L covid19.trackercli.com/us

It is currently 2:32pm where I am though receive this:
image

created as requested here

@OutdatedVersion
Copy link
Author

OutdatedVersion commented Apr 1, 2020

Implementation wise, as this is done from HTTP tools we have just a small handful of information about our user.

So far, all I can think of is performing a reverse lookup on their IP address and then determine the locale of the country they're in. Zeit has a x-now-trace header which may be something we can leverage already built into the infrastructure. Outside of that there are many services such as ipinfo.io or ipify (may add onto operating cost :/).

@OutdatedVersion OutdatedVersion changed the title support user defined time locale support user location determined response timezone/locale Apr 1, 2020
@warengonzaga warengonzaga added the bug Issue Label for Bug Reports label Apr 2, 2020
@warengonzaga warengonzaga added this to the Version 4 milestone Apr 2, 2020
@warengonzaga
Copy link
Member

@OutdatedVersion I just closed #25 due to outdated code base. Please submit a new one... Thanks!

@warengonzaga warengonzaga self-assigned this Apr 24, 2020
@gilcot
Copy link

gilcot commented May 13, 2020

Don't add complexity with third part additions, just ensure you keep worldometer's datetime: it's Zulu (GMT+0).

That datetime may be translated to user's locale if the information is available… ECMAScript has getTimezoneOffset() for that purpose.

Another thing to mention: use iso formating to be aware of cultural formating… In the screenshot, depending where you live, "4/1" may be january 4th or april 1st.

@OutdatedVersion
Copy link
Author

OutdatedVersion commented Aug 25, 2020

@gilcot The issue is that we don't have that information. A HTTP request from cURL wouldn't have the user's locale. We could add a parameter for the preferred time zone, but I don't think it is totally unreasonable that it "just works".

@warengonzaga
Copy link
Member

@OutdatedVersion thank you! As alternative I publish this project to NPM which is can be locally run and by that means the local version is using the local timezone of a user. However on our part since it runs on other server via vercel it uses the timezone on that server I guess I can convert it back to standard timezone for global reference since we can't fetch or get the timezone of every curl to the app.

@gilcot
Copy link

gilcot commented Aug 27, 2020

Don't forget @OutdatedVersion that one can add custom headers to cURL command, that's why I said it should be a translation performed only if the information is available. And otherwise just say what's the server's timezone…

@OutdatedVersion
Copy link
Author

I understand, @gilcot. If support was added for a client directed locale, as mentioned in the last message, I think it would go better as a query parameter. Originally, it seemed optimal to the UX by having it simply "work" when making requests without that much hassle on our end - as it is already built into the infrastructure we use.

@warengonzaga, I don't think an installable CLI is the best path TBH. Too much friction to start using it. What are your thoughts on a query parameter? Typing ?timezone=cst is more intuitive than -H 'X-Timezone: cst' I believe.

@warengonzaga
Copy link
Member

@OutdatedVersion good suggestion but I will consult my team if it is possible what we need for now is standard time. That's maybe the best bet.

@warengonzaga warengonzaga changed the title support user location determined response timezone/locale User Based Timezone Response Mar 29, 2021
@warengonzaga
Copy link
Member

@scinscinscin is the fix already present in v4 branch? or not?

@warengonzaga warengonzaga removed this from the Version 4 milestone Apr 4, 2021
@warengonzaga warengonzaga added hacktoberfest Hacktoberfest Related Pull Request or Issue help wanted Issue Label for Asking Help in review Issue/Pull Request Label for In Review Status labels Oct 7, 2021
@warengonzaga warengonzaga changed the title User Based Timezone Response user based timezone response Oct 8, 2021
@warengonzaga warengonzaga added todo Issue Label for Todo Status and removed in review Issue/Pull Request Label for In Review Status labels Nov 24, 2021
@warengonzaga
Copy link
Member

This issue is now stagnant. I will work on it next week.

@warengonzaga warengonzaga self-assigned this Nov 24, 2021
@warengonzaga warengonzaga added this to the v4.2.0 📦 milestone Mar 1, 2022
@warengonzaga warengonzaga removed this from the v4.2.0 📦 milestone Mar 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue Label for Bug Reports hacktoberfest Hacktoberfest Related Pull Request or Issue help wanted Issue Label for Asking Help todo Issue Label for Todo Status
Projects
None yet
Development

No branches or pull requests

4 participants