bradymholt / cRonstrue

JavaScript library that translates Cron expressions into human readable descriptions
http://bradymholt.github.io/cRonstrue/
MIT License
1.28k stars 168 forks source link

Fix multiple days of week outputs null #283

Closed fracz closed 1 year ago

fracz commented 1 year ago

fix #199

I have moved the code that adds numeric prefixes (first, second, etc) to the getSingleItemDescription. It was previously in the getDescriptionFormat and tried to find correct prefix for e.g. #3,1#2, because it took only the first weekday into consideration.

The code diff looks crazy, but if you take a closer look then you will se that I only moved the switch statement to another method and concatenated properly.

It seems to fix the problem and does not break any tests :-)

bradymholt commented 1 year ago

Thanks!!