ha-clockwork-card
ha-clockwork-card copied to clipboard
Error when no other clocks are defined
Please add handling of use case when no other clocks are given. E.g.
var otherclocks = ``;
if (_other_timezones) {
//Build List of Other Timezones
//
otherclocks = otherclocks + `
<div class = "other_clocks">
`;
var i;
var j = _other_timezones.length; //TODO: Recommend max 3.
for (i= 0; i < j; i++) {
//Format other timezones.
var _tztime = _date_time.toLocaleTimeString(_locale, {
hour: 'numeric',
minute: 'numeric',
timeZone: _other_timezones[i],
weekday: 'short'
});
// List other Timezones.
otherclocks = otherclocks + `
<div class="tz_locale">${_other_timezones[i]} </div>
<div class="otime"> ${_tztime} </div>
`;
//console.log(_tztime);
};
otherclocks = otherclocks + `
</div>
`;
/*console.log(otherclocks);*/
}
how to use this?