bradymholt / cRonstrue

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

If string has a range in first interval don't render "de" #292

Closed wlribeiro closed 1 year ago

wlribeiro commented 1 year ago

This pull request addresses an issue where double occurrences of "de" were introduced during the conversion of certain cron expressions to text in the pt_BR locale. The proposed changes ensure that the double "de" is prevented, specifically when a range is present at the beginning of the string.

expression response expected
* 1-4,7 somente de de segunda-feira a sexta-feira e domingo somente de segunda-feira a sexta-feira e domingo
1-4,6 a cada dia, somente em de janeiro a abril e junho a cada dia, somente de janeiro a abril e junho
bradymholt commented 1 year ago

Thanks!