mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Fix endTime of statistics-chart (#24233)
This commit is contained in:
parent
043e8d6e2e
commit
920ec035c5
@ -273,11 +273,13 @@ export class StatisticsChart extends LitElement {
|
|||||||
this._chartOptions = {
|
this._chartOptions = {
|
||||||
xAxis: [
|
xAxis: [
|
||||||
{
|
{
|
||||||
|
id: "xAxis",
|
||||||
type: "time",
|
type: "time",
|
||||||
min: startTime,
|
min: startTime,
|
||||||
max: endTime,
|
max: this.endTime,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
id: "hiddenAxis",
|
||||||
type: "time",
|
type: "time",
|
||||||
show: false,
|
show: false,
|
||||||
},
|
},
|
||||||
@ -368,7 +370,6 @@ export class StatisticsChart extends LitElement {
|
|||||||
if (endTime > new Date()) {
|
if (endTime > new Date()) {
|
||||||
endTime = new Date();
|
endTime = new Date();
|
||||||
}
|
}
|
||||||
this.endTime = endTime;
|
|
||||||
|
|
||||||
let unit: string | undefined | null;
|
let unit: string | undefined | null;
|
||||||
|
|
||||||
|
@ -327,7 +327,7 @@ export class HuiStatisticsGraphCard extends LitElement implements LovelaceCard {
|
|||||||
);
|
);
|
||||||
const endDate = this._energyEnd;
|
const endDate = this._energyEnd;
|
||||||
try {
|
try {
|
||||||
let unitClass;
|
let unitClass: string | undefined | null;
|
||||||
if (this._config!.unit && this._metadata) {
|
if (this._config!.unit && this._metadata) {
|
||||||
const metadata = Object.values(this._metadata).find(
|
const metadata = Object.values(this._metadata).find(
|
||||||
(metaData) =>
|
(metaData) =>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user