year-progress
Calculate how much of a calendar year has elapsed at a given moment. Returns percent elapsed/remaining, day-of-year, seconds elapsed/remaining, leap-year flag, and a 20-char ASCII progress bar. Useful for goal-tracking and 'how much of the year is left' moments.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| at | No | Reference timestamp as an ISO 8601 string (YYYY-MM-DD or full ISO datetime). If omitted, the handler treats it as 'now' — but engines are pure, so callers should pass an explicit value to keep results reproducible. | |
| year | No | Override the year. If omitted, derived from `at`. Use this to compute progress for a year other than the one containing `at` (e.g. ask 'what was 2024's progress on 2024-07-01' explicitly). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| year | Yes | The year being measured. | |
| dayOfYear | Yes | 1-indexed day number within the year (Jan 1 = 1). | |
| isLeapYear | Yes | True if the year is a leap year (366 days). | |
| daysElapsed | Yes | Full days elapsed from Jan 1 00:00 to `at`. | |
| progressBar | Yes | 20-character ASCII progress bar built from █ (filled) and ░ (empty), e.g. '████████░░░░░░░░░░░░'. | |
| daysRemaining | Yes | Full days remaining from `at` to Dec 31 23:59:59.999. | |
| percentElapsed | Yes | Percent of the year that has elapsed at `at`, 0-100, rounded to 4 decimals. | |
| secondsElapsed | Yes | Seconds elapsed from start-of-year to `at`. | |
| totalDaysInYear | Yes | 365 in normal years, 366 in leap years. | |
| percentRemaining | Yes | Percent of the year remaining after `at`, 0-100, rounded to 4 decimals. | |
| secondsRemaining | Yes | Seconds remaining from `at` to end-of-year. |