-
Platform information:
- Hardware: RPi4b 8GB
- OS: openHabian
- openHAB version: 3.0.1
-
Issue of the topic: I want to get rid off my Visual Studio Code and build in as much as possible in the new awesome GUI. I´m using duration.js to transform my “last seen” from “2021-02-03T16:54:30.106+0100” to "Wed 16:53 ". How can I handle that in the GUI with Profile / JS?
-
Please post configurations (if applicable):
// computes nicely formatted duration from given minutes
(function(i){var d = Math.floor(i / (24 * 60)); var h = Math.floor((i / 60) - (24 * d)); var m = Math.round(i - 60 * (24 * d + h)); var result = ''; // days if (d > 0) { result = result + d; if (d == 1) { result = d + " day"; } else { result = d + " days"; } } // hours if (h > 0) { if (result != '') { result = result + ', '; } result = result + h; if (h == 1) { result = result + ' hour'; } else { result = result + ' hours'; } } // minutes if (m > 0) { if (result != '') { result = result + ', '; } result = result + m; if (m == 1) { result = result + ' minute'; } else { result = result + ' minutes'; } } return result;
})(input)
- Items configuration related to the issue
Zuletzt gesehen [%1$ta %1$tR]"
- Sitemap configuration related to the issue
- Rules code related to the issue
- Services configuration related to the issue
- Items configuration related to the issue
-
If logs where generated please post these here using code fences:
It would be nice if somebody can help to convert this to on board tools. Would be also nice2have to transform it to “German” instead of “English”.
Thank you in advance.