Skip to content

Add configurable time format#22

Merged
teesofttech merged 2 commits into
masterfrom
codex/issue-7-time-format-setting
Jun 27, 2026
Merged

Add configurable time format#22
teesofttech merged 2 commits into
masterfrom
codex/issue-7-time-format-setting

Conversation

@teesofttech

Copy link
Copy Markdown
Owner

Summary

Closes #7.

Adds a configurable CronSettings.TimeFormat option so callers can choose 12-hour or 24-hour time output using standard .NET time format strings.

Changes

  • Adds CronSettings.TimeFormat with public default "hh:mm tt".
  • Tracks whether TimeFormat was explicitly set so existing language-specific defaults remain preserved unless the caller overrides them.
  • Applies the configured time format to:
    • simple scheduled times
    • hour ranges
    • minute ranges
    • time lists
    • timezone-adjusted output
  • Documents TimeFormat in both README files.
  • Adds tests for default 12-hour output, explicit 24-hour output, explicit 12-hour override, ranges, lists, and locale-default preservation.

Validation

  • dotnet test CronCraft.sln --no-restore
    • 107 passed, 0 failed
  • dotnet build CronCraft.sln --configuration Release --no-restore
    • 0 warnings, 0 errors
  • dotnet test CronCraft.sln --configuration Release --no-build
    • 107 passed, 0 failed
  • git diff --check

@coderabbitai

coderabbitai Bot commented Jun 27, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@teesofttech, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 9 minutes and 50 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 37428e3e-2bd0-4451-91bd-731ad02a0ff1

📥 Commits

Reviewing files that changed from the base of the PR and between 6a5270b and 14649b3.

📒 Files selected for processing (5)
  • CronCraft.Test/CronHelperTest.cs
  • CronCraft/Extensions/CronHelper.cs
  • CronCraft/Models/CronSettings.cs
  • CronCraft/README.md
  • README.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/issue-7-time-format-setting

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@teesofttech teesofttech changed the title [codex] Add configurable time format Add configurable time format Jun 27, 2026
@teesofttech
teesofttech marked this pull request as ready for review June 27, 2026 09:03
Copilot AI review requested due to automatic review settings June 27, 2026 09:03

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a configurable CronSettings.TimeFormat override so consumers can choose 12-hour/24-hour (or other) rendered time output while preserving existing language-specific defaults unless explicitly overridden.

Changes:

  • Introduces CronSettings.TimeFormat plus internal tracking to detect explicit overrides.
  • Threads the settings-driven time formatting through CronHelper (including ranges/lists and timezone-adjusted output).
  • Updates README usage examples and adds unit tests covering default behavior, overrides, and preservation of language defaults.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
README.md Documents TimeFormat usage in the root readme example.
CronCraft/README.md Mirrors TimeFormat documentation in the package readme example.
CronCraft/Models/CronSettings.cs Adds TimeFormat property and override-tracking behavior.
CronCraft/Extensions/CronHelper.cs Applies TimeFormat override throughout time rendering (single times, ranges, lists, timezone conversion).
CronCraft.Test/CronHelperTest.cs Adds tests for default time format, overrides, ranges/lists, and language-default preservation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +31 to +43
/// <summary>
/// .NET time format string used for rendered times.
/// Default is "hh:mm tt" for backwards-compatible 12-hour output.
/// Examples: "hh:mm tt" for 12-hour time, "HH:mm" for 24-hour time.
/// </summary>
public string TimeFormat
{
get => _timeFormat ?? "hh:mm tt";
set => _timeFormat = value;
}

internal bool HasTimeFormatOverride => !string.IsNullOrWhiteSpace(_timeFormat);

Comment thread README.md Outdated
Comment thread CronCraft/README.md Outdated
@teesofttech
teesofttech merged commit fe80bd2 into master Jun 27, 2026
3 checks 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.

Add 24-hour time format option to CronSettings

2 participants