feat: Add support for rolling & default periods #33
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
I don't think I broke anything, but it's worth a close review.