mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 15:26:36 +00:00
Fix dates on history and logbook
This commit is contained in:
parent
0a45e0e95b
commit
06edb22651
@ -86,7 +86,9 @@ Polymer({
|
|||||||
_selectedDate: {
|
_selectedDate: {
|
||||||
type: Date,
|
type: Date,
|
||||||
value: function () {
|
value: function () {
|
||||||
return new Date();
|
var begin = new Date();
|
||||||
|
begin.setHours(0, 0, 0, 0);
|
||||||
|
return begin;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -107,12 +109,6 @@ Polymer({
|
|||||||
field: document.createElement('input'),
|
field: document.createElement('input'),
|
||||||
trigger: this.$.datePicker.inputElement,
|
trigger: this.$.datePicker.inputElement,
|
||||||
onSelect: function (newDate) {
|
onSelect: function (newDate) {
|
||||||
newDate.setDate(newDate.getDate() + 1);
|
|
||||||
|
|
||||||
if (newDate > new Date()) {
|
|
||||||
newDate = new Date();
|
|
||||||
}
|
|
||||||
|
|
||||||
this._selectedDate = newDate;
|
this._selectedDate = newDate;
|
||||||
}.bind(this),
|
}.bind(this),
|
||||||
});
|
});
|
||||||
|
@ -89,7 +89,9 @@ Polymer({
|
|||||||
_selectedDate: {
|
_selectedDate: {
|
||||||
type: String,
|
type: String,
|
||||||
value: function () {
|
value: function () {
|
||||||
return new Date();
|
var begin = new Date();
|
||||||
|
begin.setHours(0, 0, 0, 0);
|
||||||
|
return begin;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -117,12 +119,6 @@ Polymer({
|
|||||||
field: document.createElement('input'),
|
field: document.createElement('input'),
|
||||||
trigger: this.$.datePicker.inputElement,
|
trigger: this.$.datePicker.inputElement,
|
||||||
onSelect: function (newDate) {
|
onSelect: function (newDate) {
|
||||||
newDate.setDate(newDate.getDate() + 1);
|
|
||||||
|
|
||||||
if (newDate > new Date()) {
|
|
||||||
newDate = new Date();
|
|
||||||
}
|
|
||||||
|
|
||||||
this._selectedDate = newDate;
|
this._selectedDate = newDate;
|
||||||
}.bind(this),
|
}.bind(this),
|
||||||
});
|
});
|
||||||
|
@ -38,8 +38,6 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
timelineDevices = timelineDevices.length > 0 && timelineDevices;
|
|
||||||
|
|
||||||
unitStates = Object.keys(lineChartDevices).map(
|
unitStates = Object.keys(lineChartDevices).map(
|
||||||
function (unit) {
|
function (unit) {
|
||||||
return { unit: unit, data: lineChartDevices[unit] };
|
return { unit: unit, data: lineChartDevices[unit] };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user