Skip to content

Fix previousRelativeTo, document the public API, release 0.3.1 - #20

Merged
justintout merged 3 commits into
mainfrom
doc/api-docs
Oct 5, 2026
Merged

justintout merged 3 commits into
mainfrom
doc/api-docs

Conversation

@justintout

@justintout justintout commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

Brings dartdoc coverage from 17/19 to 19/19 public API elements (pana), fixes a previousRelativeTo bug found while documenting it, and bumps the version to 0.3.1.

Docs:

  • Rewrites every doc comment to state what the member returns, instead of opening with the member's name.
  • Documents what the Cron constructor accepts and when it throws, including @reboot and expressions that can never match.
  • Adds a usage example to the class doc. The output shown was checked by running it.
  • States that nextRelativeTo and previousRelativeTo never return the given time, and how long a rare schedule's search takes. The worst case found was about 0.9s, for a Feb 29 schedule across 2100.
  • Adds pub.dev version and docs badges to the README.
  • dart doc --dry-run reports 0 warnings.

Fix:

  • previousRelativeTo started its search a full minute plus the leftover seconds before the given time, so it skipped a match earlier in the same minute. */15 * * * * at 16:00:30 returned 15:45 instead of 16:00. previous, sincePreviousRelativeTo and sincePrevious had the same bug. Four existing test rows asserted the old result and are corrected.

Release:

  • pubspec.yaml 0.3.1 and its CHANGELOG entry. After merging, run Release on main.

Every public member now has a dartdoc comment that states what it
returns, not just its name. The Cron constructor documents what it
accepts and when it throws, and the class has a usage example. The
README gets version and docs badges.
previousRelativeTo started its search a full minute plus the leftover
seconds before the given time, so a match earlier in the same minute
was skipped: */15 * * * * at 16:00:30 returned 15:45 instead of 16:00.
The search now starts at the whole minute at or before the given time,
excluding the given time itself.

Four test rows asserted the old result and are corrected.
@justintout justintout changed the title Document the whole public API and add pub.dev badges Fix previousRelativeTo, document the public API, release 0.3.1 Oct 5, 2026
@justintout
justintout merged commit a6de65a into main Oct 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant