benvinegar / counterscale

Scalable web analytics you run yourself on Cloudflare
https://counterscale.dev
MIT License
1.34k stars 61 forks source link

Can now select "today" for analytics results #53

Closed benvinegar closed 7 months ago

benvinegar commented 7 months ago

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:

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.

codecov[bot] commented 7 months ago

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 :warning:
app/analytics/query.ts 91.66% 6 Missing :warning:
Additional details and impacted files ```diff @@ 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 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.