Skip to content
  • David Edmundson's avatar
    applets/digital-clock: Fix date drift · 5430c3a0
    David Edmundson authored and Nate Graham's avatar Nate Graham committed
    dateTimeChanged is called every second. This in turn checks if the date
    has changed. If so we call setupLabels which updates the clock.
    
    The date label used to use main.currentTime which is a value set in the
    binding of the timeLabel's text property. The order of this being
    updated vs running this code is undefined.
    
    Bug 1: We compare an ever so slightly different date source to the one
    used in the date text label.
    
    Bug 2: We are not necessarily updating the date label with the most
    updated time.
    
    Overall we can't mix declarative and imperative design patterns. This
    patch commits to being imperative and introduces a function to get the
    current time so that the date label and time label will always get the
    most up to date value even if they update from different trigers.
    
    BUG: 452554
    FIXED-IN: 5.24.5
    5430c3a0