Use local timezone for log and history dates

This commit is contained in:
Adam Mills 2016-07-17 20:58:32 -04:00
parent c263545bda
commit eb7dc87971
3 changed files with 31 additions and 3 deletions

@ -1 +1 @@
Subproject commit b7ac88af0bf5a6065c021e47dc6af0f7006b187b
Subproject commit 3f29d9a833a4aeeda350119bffa778fe944faace

View File

@ -36,7 +36,7 @@
<div class$="[[computeContentClasses(narrow)]]">
<paper-input label='Showing entries for' id='datePicker'
value='[[selectedDate]]'></paper-input>
value='[[selectedDateStr]]'></paper-input>
<state-history-charts state-history="[[stateHistory]]"
is-loading-data="[[isLoadingData]]"></state-history-charts>
@ -94,6 +94,20 @@ Polymer({
return hass.entityHistoryGetters.currentDate;
},
},
selectedDateStr: {
type: String,
value: null,
bindNuclear: function (hass) {
return [
hass.entityHistoryGetters.currentDate,
function (currentDate) {
var dateObj = new Date(currentDate);
return dateObj.toLocaleDateString();
},
];
},
},
},
isDataLoadedChanged: function (newVal) {

View File

@ -37,7 +37,7 @@
<paper-input
label='Showing entries for'
id='datePicker'
value='[[selectedDate]]'
value='[[selectedDateStr]]'
on-focus='datepickerFocus'
></paper-input>
@ -77,6 +77,20 @@ Polymer({
},
},
selectedDateStr: {
type: String,
value: null,
bindNuclear: function (hass) {
return [
hass.logbookGetters.currentDate,
function (currentDate) {
var dateObj = new Date(currentDate);
return dateObj.toLocaleDateString();
},
];
},
},
isLoading: {
type: Boolean,
bindNuclear: function (hass) {