maennchen / crontab

Parse Cron Expressions, Compose Cron Expression Strings and Caluclate Execution Dates.
https://hex.pm/packages/crontab
MIT License
91 stars 32 forks source link

feat: add skip year option to composer #114

Closed thomas9911 closed 1 year ago

thomas9911 commented 1 year ago

The frontend library I use for my project does not support the year part. So I added an option to the composer to skip this. Might be helpfull to others.

coveralls commented 1 year ago

Coverage Status

Coverage: 96.636% (+0.02%) from 96.615% when pulling 3435f218fccbb40bc509ac5b9158123209cb37a8 on thomas9911:main into 7336e46ec23cb989a4bd007ad5c2205f9abb0abc on jshmrtn:main.

maennchen commented 1 year ago

@thomas9911 Thanks for your contribution and sorry for the wait. I just went through some surgery.

I'm thinking if ther's a need for an interface where also other parts could be left out and if we would need a different interface then. Are you aware of other restrictions in other implementations?

thomas9911 commented 1 year ago

Not that i know of. I did a quick search online and on the wikipedia page of Cron it says that year: This field is not supported in standard/default implementations.

https://en.wikipedia.org/wiki/Cron

Maybe a separate thing that can be implemented is that it can also print the @daily @weekly formats and/or that it can print FRI + DEC for weekdays and months (but that is not needed for my use case :D )