You are reading a single comment by @HughB and its replies. Click here to read the full conversation.
  • I tried it out. My only thought would be to make the full screen version a settings option.
    To implement sunrise and sunset take a look at the code in the sunrise / sunset clock_info app.

    https://raw.githubusercontent.com/esprui­no/BangleApps/master/apps/clkinfosunrise­/clkinfo.js

    (function() {
      // get today's sunlight times for lat/lon
      var sunrise, sunset, date;
      var SunCalc = require("suncalc"); // from modules folder
      const locale = require("locale");
    
      function calculate() {
        var location = require("Storage").readJSON("mylocation.­json",1)||{};
        location.lat = location.lat||51.5072;
        location.lon = location.lon||0.1276; // London
        date = new Date(Date.now());
        var times = SunCalc.getTimes(date, location.lat, location.lon);
        sunrise = times.sunrise;
        sunset = times.sunset;
        /* do we want to re-calculate this every day? Or we just assume
        that 'show' will get called once a day? */
      }
    
About

Avatar for HughB @HughB started