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

feat: Add support for rolling & default periods #33

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

madsciencetist
Copy link

I have energy dashboards for which energy-period-selector-plus selects the time period of the data. Before clicking any buttons, this time period always initialized to start from the beginning of the current day. Usage numbers would be highly variable and would depend on what time of day I happen to look at the dashboard.

My goal was to instead be able to initialize to seeing the past 24h of usage - or the past 7 days, or the past month. Always displaying the path month's worth of usage gives me a rolling view that is always more intuitive and still synchronizes with my utility bill once a month.

To enable this, I have added two new features:

  1. A toggle to interpret time periods as e.g. "the past month" instead of "the current month to date"
  2. The ability to set the default period to something other than Day.

I don't think I broke anything, but it's worth a close review.

Allow periods to be interpreted as "the past period", i.e. the past 7
days for Week, rather than "the current period", i.e. days since the
calendar week started. When viewing Today, the duration contained within
the "current" period is non-constant, but in the "past" period is
constant.
Enables dashboard to load as past 24h or past week or past month, rather
than just day since midnight.
@madsciencetist madsciencetist changed the title Add support for rolling & default periods Jan 22, 2024
@madsciencetist
Copy link
Author

@flixlix can we hope for a new release soon?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant