Adds date to systemlog entries (#1068)

* Adds date to systemlog entries

* Only return date if not today

* Fix lint

* Fix lint

* Address comments by c727

* tested and working this time

* fix lint

* remove unneeded formatDateTime function
This commit is contained in:
Charles Garwood 2018-04-05 22:51:48 -04:00 committed by Paulus Schoutsen
parent b57116f39c
commit 7967ab307c

View File

@ -57,6 +57,7 @@
@apply --paper-font-code)
clear: both;
white-space: pre-wrap;
margin: 16px;
}
.system-log-intro {
@ -309,7 +310,12 @@ class HaPanelDevInfo extends Polymer.Element {
}
formatTime(date) {
return window.hassUtil.formatTime(new Date(date * 1000));
const today = new Date().setHours(0, 0, 0, 0);
const dateTime = new Date(date * 1000);
const dateTimeDay = new Date(date * 1000).setHours(0, 0, 0, 0);
return dateTimeDay < today ?
window.hassUtil.formatDateTime(dateTime) : window.hassUtil.formatTime(dateTime);
}
openLog(event) {