mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 23:36:36 +00:00
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:
parent
b57116f39c
commit
7967ab307c
@ -57,6 +57,7 @@
|
|||||||
@apply --paper-font-code)
|
@apply --paper-font-code)
|
||||||
clear: both;
|
clear: both;
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
|
margin: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.system-log-intro {
|
.system-log-intro {
|
||||||
@ -309,7 +310,12 @@ class HaPanelDevInfo extends Polymer.Element {
|
|||||||
}
|
}
|
||||||
|
|
||||||
formatTime(date) {
|
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) {
|
openLog(event) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user