Skip to content

Commit b7eaa6f

Browse files
committed
single variable for showSunTimes sub options
1 parent 8d20af5 commit b7eaa6f

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ planned for 2025-07-01
1313

1414
### Added
1515

16-
- [clock] Added option showSunNextEvent to show/hide next sun event.
16+
- [clock] Added option 'disableNextEvent' to hide next sun event.
1717

1818
### Changed
1919

modules/default/clock/clock.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ Module.register("clock", {
2525
analogShowDate: "top", // OBSOLETE, can be replaced with analogPlacement and showTime, options: false, 'top', or 'bottom'
2626
secondsColor: "#888888", // DEPRECATED, use CSS instead. Class "clock-second-digital" for digital clock, "clock-second" for analog clock.
2727

28-
showSunTimes: false,
29-
showSunNextEvent: true,
28+
showSunTimes: false, // options: true, false, 'disableNextEvent'
3029
showMoonTimes: false, // options: false, 'times' (rise/set), 'percent' (lit percent), 'phase' (current phase), or 'both' (percent & phase)
3130
lat: 47.630539,
3231
lon: -122.344147
@@ -174,7 +173,7 @@ Module.register("clock", {
174173
const isVisible = now.isBetween(sunTimes.sunrise, sunTimes.sunset);
175174
let sunWrapperInnerHTML = "";
176175

177-
if (this.config.showSunNextEvent) {
176+
if (this.config.showSunTimes !== "disableNextEvent") {
178177
let nextEvent;
179178
if (now.isBefore(sunTimes.sunrise)) {
180179
nextEvent = sunTimes.sunrise;

tests/configs/modules/clock/clock_showSunNoEvent.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ let config = {
88
module: "clock",
99
position: "middle_center",
1010
config: {
11-
showSunTimes: true,
12-
showSunNextEvent: false
11+
showSunTimes: "disableNextEvent"
1312
}
1413
}
1514
]

0 commit comments

Comments
 (0)