Skip to content

Fix specific month descriptions#21

Merged
teesofttech merged 2 commits into
masterfrom
codex/issue-13-month-field-output
Jun 27, 2026
Merged

Fix specific month descriptions#21
teesofttech merged 2 commits into
masterfrom
codex/issue-13-month-field-output

Conversation

@teesofttech

@teesofttech teesofttech commented Jun 27, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #13.

Fixes human-readable cron output so concrete month values are no longer ignored. Expressions such as 0 9 1 3 * now describe the month as March instead of falling back to the generic monthly phrasing.

Changes

  • Adds localized month-name lookup for all currently supported languages.
  • Adds phrase support for:
    • yearly schedules on a specific month/day
    • daily schedules inside a specific month
    • month-step schedules with wildcard day-of-month
  • Preserves existing wildcard month behavior, e.g. * still produces the existing monthly/daily output.
  • Preserves month-step day-of-month behavior, e.g. */6 still produces “Every 6 months on the 27th …”.
  • Adds unit coverage for specific month, wildcard month, month-step, and localized month names.

Validation

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

Summary by CodeRabbit

  • New Features
    • Improved human-readable cron descriptions for date-based schedules, including specific month/day combinations, recurring days within a month, and month-step patterns.
    • Added/expanded localized month-name rendering across multiple languages for clearer schedule text.
  • Bug Fixes
    • Enhanced handling of edge cases (fixed dates, wildcard days, and monthly intervals) to make cron phrases more accurate.
  • Tests
    • Added broader automated coverage for month/day wording and multi-language localization output.

@coderabbitai

coderabbitai Bot commented Jun 27, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0ff7d23f-237c-4228-b9ce-affaa04cb5ab

📥 Commits

Reviewing files that changed from the base of the PR and between 1c3c0d4 and d1eada1.

📒 Files selected for processing (2)
  • CronCraft.Test/CronHelperTest.cs
  • CronCraft/Extensions/CronHelper.cs
🚧 Files skipped from review as they are similar to previous changes (1)
  • CronCraft/Extensions/CronHelper.cs

📝 Walkthrough

Walkthrough

Cron human-readable rendering now resolves specific month values into localized month names, preserves month-step and wildcard month phrasing, and adds tests for month/day cases and multi-language month-name output.

Changes

Localized month phrasing

Layer / File(s) Summary
Localized phrase templates
CronCraft/Extensions/CronHelper.cs
Supported language dictionaries add EveryYearOnMonthDay, EveryDayInMonth, and EveryXMonths templates.
Month handling logic
CronCraft/Extensions/CronHelper.cs
BuildHumanReadable now handles specific months, month steps, and wildcard months, and TryGetMonthName maps valid month numbers to localized names.
Human-readable coverage
CronCraft.Test/CronHelperTest.cs
New tests cover specific month/day cases, month-step output, and month-name localization across multiple languages.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related issues

  • Issue 13: The new month-specific rendering and localization coverage matches the reported missing specific-month output.
  • Issue 10: The added tests cover the same cron patterns and multilingual assertions described there.

Possibly related PRs

  • teesofttech/CronCraft#20: Both changes extend CronHelper localization and month/day phrasing in the human-readable cron path.

Poem

A rabbit hopped through month-name dew,
From March to June to winter blue.
One cron now sings in many tongues,
With tidy hops and friendly lungs. 🐰

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately summarizes the main change: fixing specific month descriptions.
Linked Issues check ✅ Passed The changes cover specific month handling, preserve wildcard and stepped month behavior, and add localization tests as required.
Out of Scope Changes check ✅ Passed No clearly unrelated changes are evident; the additions stay focused on month-aware cron phrasing and tests.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/issue-13-month-field-output

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] Fix specific month descriptions Fix specific month descriptions Jun 27, 2026
@teesofttech
teesofttech marked this pull request as ready for review June 27, 2026 08:28
Copilot AI review requested due to automatic review settings June 27, 2026 08:28

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

This pull request fixes human-readable cron descriptions so that concrete month values (1–12) are reflected in the output, addressing cases where the month field was previously ignored (e.g., “March”/“December” now appear in yearly phrases when appropriate).

Changes:

  • Adds month-name localization and new phrase templates to support “every year on {Month} {Day}” and “every day in {Month}” scenarios.
  • Extends the phrase builder to handle specific month values and month-step expressions (*/N) when day-of-month is a wildcard.
  • Adds unit tests covering specific month, wildcard month, month-step, and localized month-name output.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
CronCraft/Extensions/CronHelper.cs Adds localized month name lookup and updates human-readable phrase construction to incorporate specific month values and month steps.
CronCraft.Test/CronHelperTest.cs Adds tests validating specific-month phrasing and month-name localization across supported languages.

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

Comment on lines 309 to 314
if (dayOfWeek != "*" && dayOfMonth == "*")
{
if (TryGetMonthName(month, settings.Language, out var monthName))
return $"{Phrase("EveryDayOfWeek", JoinDays(dayOfWeek, daysMap))} in {monthName} {Phrase("AtTime", time)}";

return $"{Phrase("EveryDayOfWeek", JoinDays(dayOfWeek, daysMap))} {Phrase("AtTime", time)}";

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@CronCraft/Extensions/CronHelper.cs`:
- Around line 309-314: The weekday-in-month branch in CronHelper should not
concatenate the hard-coded word “in” with localized phrases. Update the
`TryGetMonthName` path in `CronHelper` to use a language-specific template such
as `EveryDayOfWeekInMonth` instead of building the string inline, keeping
`Phrase("EveryDayOfWeek", ...)`, `JoinDays(...)`, and `Phrase("AtTime", ...)`
consistent. Add or update a non-English test covering this branch to verify the
localized output for a value like `0 9 * 3 1`.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: dd5f7e7d-7486-4e9c-89d8-da38e7f24acb

📥 Commits

Reviewing files that changed from the base of the PR and between d2b7395 and 1c3c0d4.

📒 Files selected for processing (2)
  • CronCraft.Test/CronHelperTest.cs
  • CronCraft/Extensions/CronHelper.cs

Comment thread CronCraft/Extensions/CronHelper.cs
@teesofttech
teesofttech merged commit 6a5270b 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.

Fix: specific month field is ignored in human-readable output

2 participants