Some clocks do it like that
var _12hour = (require("Storage").readJSON("setting.json",1)||{})["12hour"]||false;
It reads the 12hour value from the main settings file. If the settings file can not be read it initalizes the value with false.
You can then test in your code if you need to draw a 12 hour or 24 hour value:
if (_12hour){ //do 12 hour stuff } else { //do 24 hour stuff }
@Raik started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Some clocks do it like that
It reads the 12hour value from the main settings file. If the settings file can not be read it initalizes the value with false.
You can then test in your code if you need to draw a 12 hour or 24 hour value: