File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
src/panels/lovelace/common Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -293,10 +293,14 @@ function validateScreenCondition(condition: ScreenCondition) {
293293}
294294
295295function validateTimeCondition ( condition : TimeCondition ) {
296- return (
297- ( condition . after != null || condition . before != null ) &&
298- condition . weekdays ?. every ( ( w : WeekdayShort ) => WEEKDAYS_SHORT . includes ( w ) )
299- ) ;
296+ const hasTime = condition . after != null || condition . before != null ;
297+ const hasWeekdays =
298+ condition . weekdays != null && condition . weekdays . length > 0 ;
299+ const weekdaysValid =
300+ ! hasWeekdays ||
301+ condition . weekdays ! . every ( ( w : WeekdayShort ) => WEEKDAYS_SHORT . includes ( w ) ) ;
302+
303+ return ( hasTime || hasWeekdays ) && weekdaysValid ;
300304}
301305
302306function validateUserCondition ( condition : UserCondition ) {
You can’t perform that action at this time.
0 commit comments