redpangilinan / iotawise

Track your daily habits, activity streaks, and progress with little effort.

Home Page:https://iotawise.rdev.pro

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Timezone (?) Issue on Selecting Date Range

bquay opened this issue · comments

Hey! I noticed there is a timezone issue when creating Activity Logs. When creating a log, it is automatically adding the user's Timezone (I am in EST, GMT-5)

Screenshot 2023-12-13 at 7 50 34 PM

This creates an issue when the user selects a date range. When selected, the range does not include a timezone so the logs on the last day of the range are not included in subsequent results. When manually updating the "to" date in the URL to include a time later than the timezone offset, the user will see the correct results.

Screen.Recording.2023-12-13.at.6.47.09.PM.mov

I made a quick fix by converting the dates into UTC before querying the database when filtering dates. The issue should be resolved by now.

See aeb31f8 for more info.

Re-opening because the fix is not working in production environment. I'll look more into this issue later.

Fixed the issue by changing the URL params into UTC date format. Turns out the dates are not being converted properly because they're being converted in server, not client. I can't find a way to retain the cleaner date params then converting them in client since the whole process is happening server side, so UTC date format in params will do.

Since the dates being taken from params are now UTC format, there shouldn't be timezone issues anymore.