Skip to content

Commit

Permalink
Fix period hours in electric-car tariff
Browse files Browse the repository at this point in the history
  • Loading branch information
danimart1991 committed Jul 3, 2020
1 parent 191e5b8 commit 63fa08b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dist/pvpc-hourly-pricing-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -597,12 +597,12 @@ class PVPCHourlyPricingCard extends LitElement {
break;
case 'electric_car':
const hours = new Date().getHours();
if (hours >= 13 && hours < 23) {
if (hours >= 1 && hours < 7) {
period = 'super-valley';
} else if (hours >= 13 && hours < 23) {
period = 'peak';
} else if (hours >= 1 && hours < 3) {
period = 'valley';
} else {
period = 'super-valley';
period = 'valley';
}
break;
default:
Expand Down

0 comments on commit 63fa08b

Please sign in to comment.