diff --git a/home-assistant-js b/home-assistant-js
index b7ac88af0b..114f8ad651 160000
--- a/home-assistant-js
+++ b/home-assistant-js
@@ -1 +1 @@
-Subproject commit b7ac88af0bf5a6065c021e47dc6af0f7006b187b
+Subproject commit 114f8ad6517744889b2a013a6b4836e89083df4a
diff --git a/panels/history/ha-panel-history.html b/panels/history/ha-panel-history.html
index 03879ffce3..60e800dccd 100644
--- a/panels/history/ha-panel-history.html
+++ b/panels/history/ha-panel-history.html
@@ -35,8 +35,12 @@
on-tap="handleRefreshClick">
-
+
@@ -94,6 +98,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) {
@@ -114,9 +132,14 @@ Polymer({
attached: function () {
this.datePicker = new window.Pikaday({
- field: this.$.datePicker.inputElement,
+ // Bind field to dummy input to prevent pikaday from overwriting
+ // field value with its internal formatting.
+ field: document.createElement('input'),
+ trigger: this.$.datePicker.inputElement,
onSelect: this.hass.entityHistoryActions.changeCurrentDate,
});
+ // Set the initial datePicker date, without triggering onSelect handler.
+ this.datePicker.setDate(this.selectedDate, true);
},
detached: function () {
diff --git a/panels/logbook/ha-panel-logbook.html b/panels/logbook/ha-panel-logbook.html
index d35feb5651..f3a8279c5b 100644
--- a/panels/logbook/ha-panel-logbook.html
+++ b/panels/logbook/ha-panel-logbook.html
@@ -37,7 +37,7 @@
@@ -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) {
@@ -125,9 +139,14 @@ Polymer({
attached: function () {
this.datePicker = new window.Pikaday({
- field: this.$.datePicker.inputElement,
+ // Bind field to dummy input to prevent pikaday from overwriting
+ // field value with its internal formatting.
+ field: document.createElement('input'),
+ trigger: this.$.datePicker.inputElement,
onSelect: this.hass.logbookActions.changeCurrentDate,
});
+ // Set the initial datePicker date, without triggering onSelect handler.
+ this.datePicker.setDate(this.selectedDate, true);
},
detached: function () {