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 now select "today" for analytics results #53

Merged
merged 7 commits into from
Apr 2, 2024

Conversation

benvinegar
Copy link
Owner

Refs #3

This is different from "last 24 hours" because it only shows you data from 00:00 this morning in the user's local timezone.

Does a bunch of refactoring to make this possible:

  • Adds a "Today" option to the date range selector
  • All CF query functions now take the user's local tz
  • getViewsGroupedByInterval (query.ts) now takes an explicit start date time, instead of calculating everything as offsets from day intervals (more flexible)
  • Moves some date time calculation logic to the outer dashboard.tsx loader function (a little messy)

Screenshot:
image

Note I haven't done much testing when there's 0 datapoints, e.g. if you asked for "today" at 12:43 AM your local time.

Copy link

codecov bot commented Apr 1, 2024

Codecov Report

Attention: Patch coverage is 90.90909% with 13 lines in your changes are missing coverage. Please review.

Project coverage is 74.25%. Comparing base (5f37d61) to head (c5589b2).

Files Patch % Lines
app/routes/dashboard.tsx 90.14% 7 Missing ⚠️
app/analytics/query.ts 91.66% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #53      +/-   ##
==========================================
+ Coverage   73.90%   74.25%   +0.34%     
==========================================
  Files          18       18              
  Lines        2150     2210      +60     
  Branches      141      148       +7     
==========================================
+ Hits         1589     1641      +52     
- Misses        555      563       +8     
  Partials        6        6              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@benvinegar benvinegar merged commit ebe3239 into main Apr 2, 2024
3 checks passed
@benvinegar benvinegar deleted the today-plus-yesterday branch April 2, 2024 02:57
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

Successfully merging this pull request may close these issues.

None yet

1 participant