mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-29 12:16:39 +00:00
Fix week period selectors (#6303)
This commit is contained in:
parent
19e32752bb
commit
750e7b1262
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user