Add configurable time format#22
Conversation
|
Warning Review limit reached
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 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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.TimeFormatplus 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.
| /// <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); | ||
|
|
Summary
Closes #7.
Adds a configurable
CronSettings.TimeFormatoption so callers can choose 12-hour or 24-hour time output using standard .NET time format strings.Changes
CronSettings.TimeFormatwith public default"hh:mm tt".TimeFormatwas explicitly set so existing language-specific defaults remain preserved unless the caller overrides them.TimeFormatin both README files.Validation
dotnet test CronCraft.sln --no-restoredotnet build CronCraft.sln --configuration Release --no-restoredotnet test CronCraft.sln --configuration Release --no-buildgit diff --check