MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / drawHours

Method drawHours

contributed/modClock/main.js:1008–1024  ·  view source on GitHub ↗
(d)

Source from the content-addressed store, hash-verified

1006 }
1007
1008 drawHours(d) {
1009 let h = d.getHours();
1010 if (1 == this.prefs.twelve) {
1011 let ap = 0;
1012 if (h == 12)
1013 ap = 1;
1014 if (h == 0)
1015 h = 12;
1016 if (h > 12) {
1017 ap = 1;
1018 h = h - 12;
1019 }
1020 this.display.value((` ${h} ${ap?'p':'a'}`).slice(-4));
1021 }
1022 else
1023 this.display.value((` ${d.getHours()} `).slice(-4));
1024 }
1025 draw10Min(d) {
1026 this.display.value((` ${(d.getMinutes()/10)|0} `).slice(0,4));
1027 }

Callers 2

incrementSettingMethod · 0.95
leftReleasedMethod · 0.80

Calls 2

sliceMethod · 0.65
valueMethod · 0.45

Tested by

no test coverage detected