Timezone support for displaying header with date in logbook (#2026)

* Fixed display header with date in logbook

* prettier fix
This commit is contained in:
Nikolay Vasilchuk 2018-11-09 12:59:03 +03:00 committed by Paulus Schoutsen
parent 9c2b85dd6e
commit 9f55678cb3

View File

@ -99,7 +99,9 @@ class HaLogbook extends EventsMixin(PolymerElement) {
const current = this.get("when", change.base[index]);
const previous = this.get("when", change.base[index - 1]);
return (
current && previous && current.substr(0, 10) !== previous.substr(0, 10)
current &&
previous &&
new Date(current).toDateString() !== new Date(previous).toDateString()
);
}