frontend/js/common/entity/input_dateteime_icon.js
Paulus Schoutsen 912969111f
Move all of hassUtil to JS (#1153)
* Move all of hassUtil to JS

* Fix tests
2018-05-09 21:33:31 -04:00

12 lines
330 B
JavaScript

/** Return an icon representing an input datetime state. */
import domainIcon from './domain_icon.js';
export default function inputDateTimeIcon(state) {
if (!state.attributes.has_date) {
return 'mdi:clock';
} else if (!state.attributes.has_time) {
return 'mdi:calendar';
}
return domainIcon('input_datetime');
}