• I searched the docs but maybe / hopefully I just missed the correct "search" words.

    I look for the espruino/bangle event to register on when the hardware time is set/updated.

    Background: You have a bangle clock face that renders a date. Date rendering is only required at next day switch, so you use a timeout.

    After battery drain the date is wrong (1970/1/1). You sync the date from an external source e.g. android.
    As it is a timeout based on measure time elapsed and not a "at"-event e.g. (1970/1/2) the timeout seems not to get triggered. The "at" event would/should of course triffer when date is cahnged to future.

    Therefore I want to register on the event to render an update immediately after the hw clock/rtc was (hardly) changed.

  • Hi,

    There's nothing at the moment, but you can just override the setTime function:

    var _setTime = setTime;
    setTime = function(t) {
      _setTime(t);
      // time updated
    };
    
  • Is there easy way to undo that? So I don't end up with 1000 layers of setTime if I add that every time I upload app to Bangle.js 2 ?

    btw, I'd love to have this event also for clock drift detection which needs to know if setTime is ever used.

  • Every time an app is loaded, everything starts from scratch - so realistically if you run it when your app/widget boots you don't have to worry about it getting added multiple times

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Missing Event "Esprunio On(DTchanged)" // Bangle.On(DTchanged)

Posted by Avatar for DDDanny @DDDanny

Actions