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

Changes "This Month" view to Month-to-date for current month #491

Merged
merged 6 commits into from Dec 23, 2020

Conversation

Vigasaurus
Copy link
Contributor

@Vigasaurus Vigasaurus commented Dec 20, 2020

Changes

Updates the "This Month" view to be called "Month to Date", and properly update query and prevQuery values to reflect that.
Fixes #391

I tried to get the same working for "Day to hour" or whatever it'd be called, but I was unable to get the query object to properly take a DateTime range structure, it only seems to function with Date.range() - but I did leave all the progress I had there in the initial commit, if you know an easy way to make that conversion work.

This functions in the way that Marko wanted/researched, where if today is 12/20/2020, the MTD view would compare data from 12/01/2020-12/20/2020 to 11/11/2020-11/30/2020. See screenshots below for the updated query and prevQuery objects respectively, for months December and November, respectively.

I didn't do the graph truncation here - but if it's wanted it's pretty trivial to add either from the data sent by Clickhouse or in React directly.

Tests

  • This PR does not require tests

Changelog

  • Entry has been added to changelog

Documentation

  • Docs have been updated

Screenshots

image
image

Copy link
Contributor

@ukutaht ukutaht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to simplify that conditional but otherwise looks good. This will be a great improvement! Happy to leave the day-by-day comparison for a future PR, it does require more changes.

lib/plausible/stats/query.ex Outdated Show resolved Hide resolved
@ukutaht
Copy link
Contributor

ukutaht commented Dec 23, 2020

Thanks!

@ukutaht ukutaht merged commit e2599ff into plausible:master Dec 23, 2020
oliver-kriska pushed a commit to payout-one/analytics that referenced this pull request Dec 23, 2020
…le#491)

* Initial MTD

* Adds FE support

* Removes broken Day to Time, debug statements

* Changelog

* Cleans up conditional
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

2 participants