MCPcopy Create free account
hub / github.com/basecamp/omarchy / clockFormatRing

Function clockFormatRing

shell/plugins/panels/clock/Model.js:51–60  ·  view source on GitHub ↗
(configured, configuredAlt, presets)

Source from the content-addressed store, hash-verified

49// that reshuffled itself around the current value would bounce between two
50// entries instead of walking.
51function clockFormatRing(configured, configuredAlt, presets) {
52 var ring = []
53 var candidates = (presets || []).concat([configuredAlt, configured])
54 for (var i = 0; i < candidates.length; i++) {
55 var format = String(candidates[i] === undefined || candidates[i] === null ? "" : candidates[i])
56 if (format === "" || ring.indexOf(format) !== -1) continue
57 ring.push(format)
58 }
59 return ring.length > 0 ? ring : ["HH:mm"]
60}
61
62// Next entry after `current`. An unknown current format (a hand-written one
63// that is not in the ring) starts the walk at the top.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected