Loading...
Searching...
No Matches
progress.h File Reference

How far through the hour, day, week, and year the wall clock is, as a whole percent. More...

Go to the source code of this file.

Functions

int progress_hour_pct (int min, int sec)
 How far through the current hour it is.
int progress_day_pct (int hour, int min, int sec)
 How far through the current day it is.
int progress_week_pct (int wday, int week_start, int hour, int min, int sec)
 How far through the current week it is, counting from the day the week starts on.
int progress_year_pct (int year, int yday, int hour, int min, int sec)
 How far through the current year it is, with February getting its leap day.
int progress_week_day (int wday, int week_start)
 How many days the week has run, counting the first day as day 1.

Detailed Description

How far through the hour, day, week, and year the wall clock is, as a whole percent.

It takes the same fields a struct tm carries, one at a time, so it needs no Pebble services and can be tested off the watch. Year is the full year (2026). Weekday is 0 Sunday to 6 Saturday. Day of the year (yday) counts January 1st as 0, like tm_yday.

Every answer runs on the wall clock, so a day is always 24 hours. On the night the clocks go forward an hour the day bar jumps about 4% at once, and on the night they go back it drops about 4% and runs that hour again. The week and year bars move by the same hour, which is under 1% of either.

Each percent is rounded down and stops at 99, so a bar only reads full once the next period has started and it is back at 0.