diff --git a/src/panels/history/ha-panel-history.ts b/src/panels/history/ha-panel-history.ts index 19f98d3f60..21e43a2aa7 100644 --- a/src/panels/history/ha-panel-history.ts +++ b/src/panels/history/ha-panel-history.ts @@ -111,7 +111,7 @@ class HaPanelHistory extends LitElement { todayCopy.setDate(today.getDate() - today.getDay()) ); const thisWeekEnd = new Date( - todayCopy.setDate(today.getDate() - today.getDay() + 7) + todayCopy.setDate(thisWeekStart.getDate() + 7) ); thisWeekEnd.setMilliseconds(thisWeekEnd.getMilliseconds() - 1); @@ -119,7 +119,7 @@ class HaPanelHistory extends LitElement { todayCopy.setDate(today.getDate() - today.getDay() - 7) ); const lastWeekEnd = new Date( - todayCopy.setDate(today.getDate() - today.getDay()) + todayCopy.setDate(lastWeekStart.getDate() + 7) ); lastWeekEnd.setMilliseconds(lastWeekEnd.getMilliseconds() - 1); diff --git a/src/panels/logbook/ha-panel-logbook.ts b/src/panels/logbook/ha-panel-logbook.ts index b51c07d50c..b2c3d96b85 100644 --- a/src/panels/logbook/ha-panel-logbook.ts +++ b/src/panels/logbook/ha-panel-logbook.ts @@ -149,7 +149,7 @@ export class HaPanelLogbook extends LitElement { todayCopy.setDate(today.getDate() - today.getDay()) ); const thisWeekEnd = new Date( - todayCopy.setDate(today.getDate() - today.getDay() + 7) + todayCopy.setDate(thisWeekStart.getDate() + 7) ); thisWeekEnd.setMilliseconds(thisWeekEnd.getMilliseconds() - 1); @@ -157,7 +157,7 @@ export class HaPanelLogbook extends LitElement { todayCopy.setDate(today.getDate() - today.getDay() - 7) ); const lastWeekEnd = new Date( - todayCopy.setDate(today.getDate() - today.getDay()) + todayCopy.setDate(lastWeekStart.getDate() + 7) ); lastWeekEnd.setMilliseconds(lastWeekEnd.getMilliseconds() - 1);