Skip to content

Support named weekdays (MON, TUE...) and months (JAN, FEB...) in cron expressions #6

Description

@teesofttech

Description

Many cron tools allow named weekdays (MON, TUE, WED, THU, FRI, SAT, SUN) and named months (JAN, FEB, MAR, etc.) in place of numbers. CronCraft does not currently normalize these before parsing, so expressions using text names produce incorrect results.

Current Behavior

"0 9 * JAN MON".ToHumanReadable(settings);
// → Incorrect/unexpected output

Expected Behavior

Named values should be normalized to their numeric equivalents before parsing:

"0 9 * JAN MON".ToHumanReadable(settings);
// → "Every Monday at 09:00 AM" (in January)

"0 9 * * MON-FRI".ToHumanReadable(settings);
// → "Every Monday through Friday at 09:00 AM"

"0 0 1 JAN,JUL *".ToHumanReadable(settings);
// → "Every year on January 1st and July 1st at 12:00 AM"

Normalization Map

Weekdays: SUN=0, MON=1, TUE=2, WED=3, THU=4, FRI=5, SAT=6

Months: JAN=1, FEB=2, MAR=3, APR=4, MAY=5, JUN=6, JUL=7, AUG=8, SEP=9, OCT=10, NOV=11, DEC=12

Where to Look

  • CronCraft/Extensions/CronHelper.cs — add a normalization step in ConvertQuartzToCronos or at the start of BuildHumanReadable.

Acceptance Criteria

  • All 7 weekday abbreviations are normalized before parsing
  • All 12 month abbreviations are normalized before parsing
  • Case-insensitive matching (e.g., mon, Mon, MON all work)
  • Named values work in range and list patterns
  • Unit tests cover all abbreviations and case variations

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions