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

UTC Query #230

Closed
Dan-613 opened this issue Nov 9, 2024 · 4 comments
Closed

UTC Query #230

Dan-613 opened this issue Nov 9, 2024 · 4 comments
Labels
question Further information is requested

Comments

@Dan-613
Copy link
Contributor

Dan-613 commented Nov 9, 2024

Is this correct? Converting to UTC? What happens if the user is not UTC-based?

if (this.Date > DateTime.Today.ToUniversalTime().AddDays(1) && amount > 0)

@Dan-613 Dan-613 added the question Further information is requested label Nov 9, 2024
@FelipePSoares
Copy link
Owner

@Dan-613 maybe It's not correct.
I was having a lot of issues with date because of the time, but the wird thing is I use only date, not the time, I don't care about the time, but it happens exactly because of that, for example I'm +1 hour. If I try to add a expense between midnight to 4am I'll face this problem because the server is on EUA. Because of that I decided to validate everything using UTC and the problem occours just between midnight and 1am and even in the front-end every date is UTC.

But this don't solve every problem because there is people in a lot of time zones, I need to take a time to work on it and find the best approach.

@Dan-613
Copy link
Contributor Author

Dan-613 commented Nov 11, 2024

I think the only way around that is to ask the user for their timezone and then handle all date validation using that timezone.

For a user in Australia not to be able to enter today's date becuase it's not today in UTC, they would be prevented from using the system.

The alternative is using something like moment.js to handle conversion between local timezone and UTC but I've not properly thought that through yet and might not be possible since we are ignoring the time of day.

@FelipePSoares
Copy link
Owner

Yes, maybe this is the best approach, ask for user in the first login as first and last name. I'm thinking in ask for currency in this screen also, then we can configure application to format all currency in application.

I'll take some time to plan and write issues for this tomorrow.

@FelipePSoares
Copy link
Owner

I got some time today and already created the issues, I'll close this one now. Thank you for you help again.

Issues :
#233
#234
#235
#236
#237

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants