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
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
Expected Behavior
Named values should be normalized to their numeric equivalents before parsing:
Normalization Map
Weekdays:
SUN=0,MON=1,TUE=2,WED=3,THU=4,FRI=5,SAT=6Months:
JAN=1,FEB=2,MAR=3,APR=4,MAY=5,JUN=6,JUL=7,AUG=8,SEP=9,OCT=10,NOV=11,DEC=12Where to Look
CronCraft/Extensions/CronHelper.cs— add a normalization step inConvertQuartzToCronosor at the start ofBuildHumanReadable.Acceptance Criteria
mon,Mon,MONall work)