Documentation of aggregation methods would be nice

I was looking at clocky to measure total sleep time: I’d hoped that if I set my deadline to 14:00, then I could add a datapoint of (say) 22:00 for when I went to bed, add the next datapoint for 06:15 when I get up, and because those are logically on the same day (after the 14:00 deadline), it would faithfully report that I’d slept for 08:15 hours.

Sadly it doesn’t work like that at all, it just looks for differences between the datapoints. I’m running a test goal right now, and it’s not even clear to me what it’s going to do for a pair of datapoints like (22:00, 06:15). They are on diferent physical days, but it’s the same logical beeminder day as the deadline for the goal is at 14:00, and just skimming the code I’m not sure how that cashes out.

So: can we have a nice time_interval function that actually works as one would expect here, including intervals that cross midnight (if they’re on the same logical day)?

Pseudocode is something like:

  • for each time, calculate elapsed_time since deadline:
    • if time>deadline elapsed_time = time - deadline
      else elapsed_time = time - deadline + 24
  • take pairwise differences of these elapsed_times
3 Likes